Commit ad33d95d by Dominik Prokop Committed by Torkel Ödegaard

Graphite: Use data frames when procesing annotation query in graphite ds (#20857)

* Use data frames when procesing annotation query in graphite ds

* Remove destruct
parent 4c9cb415
...@@ -177,22 +177,24 @@ export class GraphiteDatasource extends DataSourceApi<GraphiteQuery, GraphiteOpt ...@@ -177,22 +177,24 @@ export class GraphiteDatasource extends DataSourceApi<GraphiteQuery, GraphiteOpt
maxDataPoints: 100, maxDataPoints: 100,
} as unknown) as DataQueryRequest<GraphiteQuery>; } as unknown) as DataQueryRequest<GraphiteQuery>;
return this.query(graphiteQuery).then((result: { data: any[] }) => { return this.query(graphiteQuery).then(result => {
const list = []; const list = [];
for (let i = 0; i < result.data.length; i++) { for (let i = 0; i < result.data.length; i++) {
const target = result.data[i]; const target = result.data[i];
for (let y = 0; y < target.datapoints.length; y++) { for (let y = 0; y < target.length; y++) {
const datapoint = target.datapoints[y]; const time = target.fields[1].values.get(y);
if (!datapoint[0]) { const value = target.fields[0].values.get(y);
if (!value) {
continue; continue;
} }
list.push({ list.push({
annotation: options.annotation, annotation: options.annotation,
time: datapoint[1], time,
title: target.target, title: target.name,
}); });
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment