TestDatasource: Generate refId for the flame graph (#71547)

* Remove hardcoded refId

* Generate correct refId for flameGraph
This commit is contained in:
Piotr Jamróz 2023-07-14 15:15:50 +02:00 committed by GitHub
parent 6ad8009106
commit dc4cedd298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -95,7 +95,7 @@ export class TestDataDataSource extends DataSourceWithBackend<TestData> {
streams.push(this.nodesQuery(target, options));
break;
case 'flame_graph':
streams.push(this.flameGraphQuery());
streams.push(this.flameGraphQuery(target));
break;
case 'trace':
streams.push(this.trace(target, options));
@ -242,8 +242,8 @@ export class TestDataDataSource extends DataSourceWithBackend<TestData> {
return of({ data: frames }).pipe(delay(100));
}
flameGraphQuery(): Observable<DataQueryResponse> {
return of({ data: [flameGraphData] }).pipe(delay(100));
flameGraphQuery(target: TestData): Observable<DataQueryResponse> {
return of({ data: [{ ...flameGraphData, refId: target.refId }] }).pipe(delay(100));
}
trace(target: TestData, options: DataQueryRequest<TestData>): Observable<DataQueryResponse> {

View File

@ -2,7 +2,6 @@ import { DataFrameDTO } from '@grafana/data';
export const flameGraphData: DataFrameDTO = {
name: 'response',
refId: 'A',
// @ts-ignore
meta: { preferredVisualisationType: 'flamegraph' },
fields: [