* improve performance of transformMetricFindResponse
* use lodash uniqBy for postgres
* use lodash uniqBy for mysql
* use lodash uniqBy for mssql
* hopefully conform to import linting rules
* Added .betterer.results
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Victor Marin <victor.marin@grafana.com>
(cherry picked from commit 683f31f2c6)
Co-authored-by: Nathaniel Saxe <NathanielSaxophone@gmail.com>
This commit is contained in:
co-authored by
Nathaniel Saxe
parent
db5dee09d2
commit
ddfdc9ee7a
@@ -1,3 +1,5 @@
|
||||
import { uniqBy } from 'lodash';
|
||||
|
||||
import { AnnotationEvent, DataFrame, MetricFindValue } from '@grafana/data';
|
||||
import { BackendDataSourceResponse, toDataQueryResponse, FetchResponse } from '@grafana/runtime';
|
||||
|
||||
@@ -29,10 +31,7 @@ export default class ResponseParser {
|
||||
);
|
||||
}
|
||||
|
||||
return Array.from(new Set(values.map((v) => v.text))).map((text) => ({
|
||||
text,
|
||||
value: values.find((v) => v.text === text)?.value,
|
||||
}));
|
||||
return uniqBy(values, 'text');
|
||||
}
|
||||
|
||||
async transformAnnotationResponse(options: any, data: BackendDataSourceResponse): Promise<AnnotationEvent[]> {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { uniqBy } from 'lodash';
|
||||
|
||||
import { AnnotationEvent, DataFrame, MetricFindValue } from '@grafana/data';
|
||||
import { BackendDataSourceResponse, FetchResponse, toDataQueryResponse } from '@grafana/runtime';
|
||||
|
||||
@@ -29,10 +31,7 @@ export default class ResponseParser {
|
||||
);
|
||||
}
|
||||
|
||||
return Array.from(new Set(values.map((v) => v.text))).map((text) => ({
|
||||
text,
|
||||
value: values.find((v) => v.text === text)?.value,
|
||||
}));
|
||||
return uniqBy(values, 'text');
|
||||
}
|
||||
|
||||
async transformAnnotationResponse(options: any, data: BackendDataSourceResponse): Promise<AnnotationEvent[]> {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { uniqBy } from 'lodash';
|
||||
|
||||
import { AnnotationEvent, DataFrame, MetricFindValue } from '@grafana/data';
|
||||
import { BackendDataSourceResponse, FetchResponse, toDataQueryResponse } from '@grafana/runtime';
|
||||
|
||||
@@ -29,10 +31,7 @@ export default class ResponseParser {
|
||||
);
|
||||
}
|
||||
|
||||
return Array.from(new Set(values.map((v) => v.text))).map((text) => ({
|
||||
text,
|
||||
value: values.find((v) => v.text === text)?.value,
|
||||
}));
|
||||
return uniqBy(values, 'text');
|
||||
}
|
||||
|
||||
async transformAnnotationResponse(options: any, data: BackendDataSourceResponse): Promise<AnnotationEvent[]> {
|
||||
|
||||
Reference in New Issue
Block a user