Live: performance tests e2e part (#43915)

* #41993: live perf tests e2e part

* #41993: added bash upgrade instructions

* #41993: remove custom feature toggle

* #41993: fix typo in 'integrationFolder'
This commit is contained in:
Artur Wierzbicki
2022-01-12 22:15:29 +04:00
committed by GitHub
parent 0c88b39162
commit e01ac44cfa
23 changed files with 1099 additions and 30 deletions
+41
View File
@@ -0,0 +1,41 @@
import { e2e } from '@grafana/e2e';
type WithGrafanaRuntime<T> = T & {
grafanaRuntime: {
livePerformance: {
start: () => void;
getStats: () => Record<string, unknown>;
};
};
};
const hasGrafanaRuntime = <T>(obj: T): obj is WithGrafanaRuntime<T> => {
return typeof (obj as any)?.grafanaRuntime === 'object';
};
e2e.benchmark({
name: 'Live performance benchmarking - 4x20hz panels',
dashboard: {
folder: '/dashboards/live',
delayAfterOpening: 1000,
skipPanelValidation: true,
},
repeat: 10,
duration: 120000,
appStats: {
startCollecting: (window) => {
if (!hasGrafanaRuntime(window)) {
return;
}
return window.grafanaRuntime.livePerformance.start();
},
collect: (window) => {
if (!hasGrafanaRuntime(window)) {
return {};
}
return window.grafanaRuntime.livePerformance.getStats() ?? {};
},
},
});