diff --git a/src/hooks/useMetricsProcessor.ts b/src/hooks/useMetricsProcessor.ts index 54dc3a19..979d9507 100644 --- a/src/hooks/useMetricsProcessor.ts +++ b/src/hooks/useMetricsProcessor.ts @@ -213,8 +213,13 @@ export function useSourceProcessor( source[m] = aggregation(Number(Object.values(resp.data)[0]), c); } if ( - type === MetricQueryTypes.SortMetrics || - type === MetricQueryTypes.ReadSampledRecords + ( + [ + MetricQueryTypes.ReadRecords, + MetricQueryTypes.ReadSampledRecords, + MetricQueryTypes.SortMetrics, + ] as string[] + ).includes(type) ) { source[m] = (Object.values(resp.data)[0] || []).map( (d: { value: unknown; name: string }) => { diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts index 534aeea6..c1edb5af 100644 --- a/src/views/dashboard/data.ts +++ b/src/views/dashboard/data.ts @@ -134,10 +134,7 @@ export const MetricTypes: { HEATMAP: [ { label: "read heatmap values in the duration", value: "readHeatMap" }, ], - SAMPLED_RECORD: [ - { label: "get sorted topN values", value: "readRecords" }, - { label: "get sorted topN values", value: "readSampledRecords" }, - ], + SAMPLED_RECORD: [{ label: "get sorted topN values", value: "readRecords" }], }; export enum MetricCatalog {