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

* Use data frames when procesing annotation query in graphite ds

* Remove destruct
This commit is contained in:
Dominik Prokop 2019-12-04 18:07:11 +01:00 committed by Torkel Ödegaard
parent 4c9cb415ec
commit ad33d95dd3

View File

@ -177,22 +177,24 @@ export class GraphiteDatasource extends DataSourceApi<GraphiteQuery, GraphiteOpt
maxDataPoints: 100,
} as unknown) as DataQueryRequest<GraphiteQuery>;
return this.query(graphiteQuery).then((result: { data: any[] }) => {
return this.query(graphiteQuery).then(result => {
const list = [];
for (let i = 0; i < result.data.length; i++) {
const target = result.data[i];
for (let y = 0; y < target.datapoints.length; y++) {
const datapoint = target.datapoints[y];
if (!datapoint[0]) {
for (let y = 0; y < target.length; y++) {
const time = target.fields[1].values.get(y);
const value = target.fields[0].values.get(y);
if (!value) {
continue;
}
list.push({
annotation: options.annotation,
time: datapoint[1],
title: target.target,
time,
title: target.name,
});
}
}