metrics.tsx 940 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. export type MetricsType = 'set' | 'counter' | 'distribution' | 'numeric';
  2. export type MetricsOperation =
  3. | 'sum'
  4. | 'count_unique'
  5. | 'avg'
  6. | 'count'
  7. | 'max'
  8. | 'p50'
  9. | 'p75'
  10. | 'p95'
  11. | 'p99';
  12. export type MetricsApiResponse = {
  13. end: string;
  14. groups: {
  15. by: Record<string, string>;
  16. series?: Record<string, Array<number | null>>;
  17. totals?: Record<string, number | null>;
  18. }[];
  19. intervals: string[];
  20. meta: MetricsMeta[];
  21. query: string;
  22. start: string;
  23. };
  24. export type MetricsTagCollection = Record<string, MetricsTag>;
  25. export type MetricsTag = {
  26. key: string;
  27. };
  28. export type MetricsTagValue = {
  29. key: string;
  30. value: string;
  31. };
  32. export type MetricsMeta = {
  33. mri: string;
  34. name: string;
  35. operations: MetricsOperation[];
  36. type: MetricsType; // TODO(ddm): I think this is wrong, api returns "c" instead of "counter"
  37. unit: string;
  38. };
  39. export type MetricsMetaCollection = Record<string, MetricsMeta>;