mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
FlameGraph: Add user interaction reporting (#68458)
This commit is contained in:
parent
35ccfa6131
commit
47b7b05591
@ -4,8 +4,10 @@ import useDebounce from 'react-use/lib/useDebounce';
|
||||
import usePrevious from 'react-use/lib/usePrevious';
|
||||
|
||||
import { GrafanaTheme2, CoreApp } from '@grafana/data';
|
||||
import { reportInteraction } from '@grafana/runtime';
|
||||
import { Button, Input, RadioButtonGroup, useStyles2 } from '@grafana/ui';
|
||||
|
||||
import { config } from '../../../../core/config';
|
||||
import { MIN_WIDTH_TO_SHOW_BOTH_TOPTABLE_AND_FLAMEGRAPH } from '../constants';
|
||||
|
||||
import { SelectedView } from './types';
|
||||
@ -85,6 +87,11 @@ const FlameGraphHeader = ({
|
||||
options={viewOptions}
|
||||
value={selectedView}
|
||||
onChange={(view) => {
|
||||
reportInteraction('grafana_flamegraph_view_selected', {
|
||||
app,
|
||||
grafana_version: config.buildInfo.version,
|
||||
view,
|
||||
});
|
||||
setSelectedView(view);
|
||||
}}
|
||||
/>
|
||||
|
@ -3,7 +3,7 @@ import React, { useState } from 'react';
|
||||
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||
|
||||
import { applyFieldOverrides, CoreApp, DataFrame, DataLinkClickEvent, Field, FieldType } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { config, reportInteraction } from '@grafana/runtime';
|
||||
import { Table, TableSortByFieldState, useStyles2 } from '@grafana/ui';
|
||||
|
||||
import { PIXELS_PER_LEVEL, TOP_TABLE_COLUMN_WIDTH } from '../../constants';
|
||||
@ -41,6 +41,10 @@ const FlameGraphTopTableContainer = ({
|
||||
if (search === symbol) {
|
||||
setSearch('');
|
||||
} else {
|
||||
reportInteraction('grafana_flamegraph_table_item_selected', {
|
||||
app,
|
||||
grafana_version: config.buildInfo.version,
|
||||
});
|
||||
setSearch(symbol);
|
||||
// Reset selected level in flamegraph when selecting row in top table
|
||||
setTopLevelIndex(0);
|
||||
@ -65,6 +69,13 @@ const FlameGraphTopTableContainer = ({
|
||||
<Table
|
||||
initialSortBy={sort}
|
||||
onSortByChange={(s) => {
|
||||
if (s && s.length) {
|
||||
reportInteraction('grafana_flamegraph_table_sort_selected', {
|
||||
app,
|
||||
grafana_version: config.buildInfo.version,
|
||||
sort: s[0].displayName + '_' + (s[0].desc ? 'desc' : 'asc'),
|
||||
});
|
||||
}
|
||||
setSort(s);
|
||||
}}
|
||||
data={frame}
|
||||
|
Loading…
Reference in New Issue
Block a user