From ee22b0c21eb067d522a74581f1309b1e81b25636 Mon Sep 17 00:00:00 2001 From: Matthew Heidemann Date: Wed, 21 Aug 2024 20:34:53 -0600 Subject: [PATCH] Fix Array Vector deprecation (#55) * Updated ArrayVector to use Array per deprecation * Fix imports --- src/preprocessors/timeseries.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/preprocessors/timeseries.ts b/src/preprocessors/timeseries.ts index 69078bb..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'; @@ -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; } }); }