Skip to content

Commit

Permalink
Fix Array Vector deprecation (#55)
Browse files Browse the repository at this point in the history
* Updated ArrayVector to use Array per deprecation

* Fix imports
  • Loading branch information
heidmotron authored Aug 22, 2024
1 parent ffed0d0 commit ee22b0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/preprocessors/timeseries.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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<number>(timestamps.length);

// API will currently return undefined for series.points for series without
// data instead of an empty array
Expand All @@ -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;
}
});
}
Expand Down

0 comments on commit ee22b0c

Please sign in to comment.