Просмотр исходного кода

feat(performance): Queues module function types (#69333)

Updates query types around functions and responses, for use in upcoming
queues module queries
edwardgou-sentry 10 месяцев назад
Родитель
Сommit
fd5f117de3
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      static/app/views/starfish/types.tsx

+ 13 - 0
static/app/views/starfish/types.tsx

@@ -76,6 +76,8 @@ export const AGGREGATES = [...COUNTER_AGGREGATES, ...DISTRIBUTION_AGGREGATES] as
 
 export type Aggregate = (typeof AGGREGATES)[number];
 
+export type ConditionalAggregate = `avg_if` | `count_op`;
+
 export const SPAN_FUNCTIONS = [
   'sps',
   'spm',
@@ -118,6 +120,11 @@ export type MetricsResponse = {
   [Function in RegressionFunctions]: number;
 } & {
   [Function in SpanAnyFunction]: string;
+} & {
+  [Property in ConditionalAggregate as
+    | `${Property}(${string})`
+    | `${Property}(${string},${string})`
+    | `${Property}(${string},${string},${string})`]: number;
 };
 
 export type MetricsFilters = {
@@ -158,6 +165,9 @@ export enum SpanIndexedField {
   TOTAL_SCORE = 'measurements.score.total',
   RESPONSE_CODE = 'span.status_code',
   CACHE_HIT = 'cache.hit',
+  MESSAGE_ID = 'message.id',
+  MESSAGE_SIZE = 'message.size',
+  MESSAGE_STATUS = 'message.status',
 }
 
 export type IndexedResponse = {
@@ -192,6 +202,9 @@ export type IndexedResponse = {
   [SpanIndexedField.TOTAL_SCORE]: number;
   [SpanIndexedField.RESPONSE_CODE]: string;
   [SpanIndexedField.CACHE_HIT]: '' | 'true' | 'false';
+  [SpanIndexedField.MESSAGE_ID]: string;
+  [SpanIndexedField.MESSAGE_SIZE]: number;
+  [SpanIndexedField.MESSAGE_STATUS]: string;
 };
 
 export type IndexedProperty = keyof IndexedResponse;