mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PanelQueryRunner: Shallow diff series DataFrames (#79257)
This commit is contained in:
parent
0c1d1c6b6e
commit
19cda38f1b
@ -336,9 +336,30 @@ export class PanelQueryRunner {
|
|||||||
|
|
||||||
this.subscription = panelData.subscribe({
|
this.subscription = panelData.subscribe({
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
this.lastResult = skipPreProcess ? data : preProcessPanelData(data, this.lastResult);
|
const last = this.lastResult;
|
||||||
|
const next = skipPreProcess ? data : preProcessPanelData(data, last);
|
||||||
|
|
||||||
|
if (last != null) {
|
||||||
|
let sameSeries = compareArrayValues(last.series ?? [], next.series ?? [], (a, b) => a === b);
|
||||||
|
let sameAnnotations = compareArrayValues(last.annotations ?? [], next.annotations ?? [], (a, b) => a === b);
|
||||||
|
|
||||||
|
if (sameSeries) {
|
||||||
|
next.series = last.series;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sameAnnotations) {
|
||||||
|
next.annotations = last.annotations;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sameSeries && sameAnnotations) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastResult = next;
|
||||||
|
|
||||||
// Store preprocessed query results for applying overrides later on in the pipeline
|
// Store preprocessed query results for applying overrides later on in the pipeline
|
||||||
this.subject.next(this.lastResult);
|
this.subject.next(next);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user