From 93eea2ec540c2106e3c4c65dcae8b34f31ca35e7 Mon Sep 17 00:00:00 2001 From: Matthew Heidemann Date: Wed, 21 Aug 2024 12:13:21 -0600 Subject: [PATCH 1/2] Updated ArrayVector to use Array per deprecation --- src/preprocessors/timeseries.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/preprocessors/timeseries.ts b/src/preprocessors/timeseries.ts index 69078bb..07b40ae 100644 --- a/src/preprocessors/timeseries.ts +++ b/src/preprocessors/timeseries.ts @@ -50,11 +50,11 @@ export function preprocessTimeseries(res: QueryTimeseriesRes, query: LightstepQu const timestampToIndexMap = createTimestampMap(timestamps); const dataFrameFields: Field[] = [ - { name: 'Time', type: FieldType.time, values: new ArrayVector(timestamps), config: {} }, + { name: 'Time', type: FieldType.time, values: timestamps, config: {} }, ]; series.forEach((s) => { - const values = new ArrayVector(new Array(timestamps.length)); + const values = new Array(timestamps.length); // API will currently return undefined for series.points for series without // data instead of an empty array @@ -63,7 +63,7 @@ export function preprocessTimeseries(res: QueryTimeseriesRes, query: LightstepQu const timestampIndex = timestampToIndexMap.get(timestamp); if (timestampIndex !== undefined) { - values.set(timestampIndex, value); + values[timestampIndex] = value; } }); } From 0de375997c733a56b1454da6b3de77d8fa5dc133 Mon Sep 17 00:00:00 2001 From: Matthew Heidemann Date: Wed, 21 Aug 2024 12:23:58 -0600 Subject: [PATCH 2/2] Fix imports --- src/preprocessors/timeseries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/preprocessors/timeseries.ts b/src/preprocessors/timeseries.ts index 07b40ae..76cedc9 100644 --- a/src/preprocessors/timeseries.ts +++ b/src/preprocessors/timeseries.ts @@ -1,4 +1,4 @@ -import { ArrayVector, Field, FieldType, MutableDataFrame } from '@grafana/data'; +import { Field, FieldType, MutableDataFrame } from '@grafana/data'; import { getTemplateSrv } from '@grafana/runtime'; import { LightstepQuery, QueryTimeseriesRes } from '../types';