fix: update metric processor for the readRecords and remove readSampledRecords from metrics selector (#191)

This commit is contained in:
Fine0830 2022-11-24 18:51:21 +08:00 committed by GitHub
parent 7d802d490e
commit 7a1c83b5fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -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 }) => {

View File

@ -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 {