Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Array Vector deprecation #55

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading