mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TestDatasource: Generate refId for the flame graph (#71547)
* Remove hardcoded refId * Generate correct refId for flameGraph
This commit is contained in:
parent
6ad8009106
commit
dc4cedd298
@ -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> {
|
||||
|
@ -2,7 +2,6 @@ import { DataFrameDTO } from '@grafana/data';
|
||||
|
||||
export const flameGraphData: DataFrameDTO = {
|
||||
name: 'response',
|
||||
refId: 'A',
|
||||
// @ts-ignore
|
||||
meta: { preferredVisualisationType: 'flamegraph' },
|
||||
fields: [
|
||||
|
Loading…
Reference in New Issue
Block a user