mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
parent
4c9cb415ec
commit
ad33d95dd3
@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user