mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
Default to flamegraph (#56733)
This commit is contained in:
parent
7c10082c57
commit
78061260fb
@ -110,11 +110,12 @@ describe('addPanelToDashboard', () => {
|
||||
expectedPanel: string;
|
||||
};
|
||||
it.each`
|
||||
framesType | expectedPanel
|
||||
${'logsFrames'} | ${'logs'}
|
||||
${'graphFrames'} | ${'timeseries'}
|
||||
${'nodeGraphFrames'} | ${'nodeGraph'}
|
||||
${'traceFrames'} | ${'traces'}
|
||||
framesType | expectedPanel
|
||||
${'logsFrames'} | ${'logs'}
|
||||
${'graphFrames'} | ${'timeseries'}
|
||||
${'nodeGraphFrames'} | ${'nodeGraph'}
|
||||
${'flameGraphFrames'} | ${'flamegraph'}
|
||||
${'traceFrames'} | ${'traces'}
|
||||
`(
|
||||
'Sets visualization to $expectedPanel if there are $frameType frames',
|
||||
async ({ framesType, expectedPanel }: TestArgs) => {
|
||||
|
@ -63,8 +63,10 @@ const hasRefId = (refId: DataFrame['refId']) => (frame: DataFrame) => frame.refI
|
||||
|
||||
function getPanelType(queries: DataQuery[], queryResponse: ExplorePanelData) {
|
||||
for (const { refId } of queries.filter(isVisible)) {
|
||||
// traceview is not supported in dashboards, skipping it for now.
|
||||
const hasQueryRefId = hasRefId(refId);
|
||||
if (queryResponse.flameGraphFrames.some(hasQueryRefId)) {
|
||||
return 'flamegraph';
|
||||
}
|
||||
if (queryResponse.graphFrames.some(hasQueryRefId)) {
|
||||
return 'timeseries';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user