Skip to content

Commit

Permalink
Merge "ui: de-controllify aggregators" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
primiano authored and Gerrit Code Review committed Sep 26, 2024
2 parents 05a2df8 + bb214f1 commit 88ca818
Show file tree
Hide file tree
Showing 31 changed files with 515 additions and 536 deletions.
29 changes: 0 additions & 29 deletions ui/src/common/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,35 +150,6 @@ export const StateActions = {
state.traceUuid = args.traceUuid;
},

updateAggregateSorting(
state: StateDraft,
args: {id: string; column: string},
) {
let prefs = state.aggregatePreferences[args.id];
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (!prefs) {
prefs = {id: args.id};
state.aggregatePreferences[args.id] = prefs;
}

if (!prefs.sorting || prefs.sorting.column !== args.column) {
// No sorting set for current column.
state.aggregatePreferences[args.id].sorting = {
column: args.column,
direction: 'DESC',
};
} else if (prefs.sorting.direction === 'DESC') {
// Toggle the direction if the column is currently sorted.
state.aggregatePreferences[args.id].sorting = {
column: args.column,
direction: 'ASC',
};
} else {
// If direction is currently 'ASC' toggle to no sorting.
state.aggregatePreferences[args.id].sorting = undefined;
}
},

requestTrackReload(state: StateDraft, _: {}) {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (state.lastTrackReloadRequest) {
Expand Down
1 change: 0 additions & 1 deletion ui/src/common/empty_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export function createEmptyState(): State {
version: STATE_VERSION,
nextId: '-1',
newEngineMode: 'USE_HTTP_RPC_IF_AVAILABLE',
aggregatePreferences: {},
queries: {},

recordConfig: AUTOLOAD_STARTED_CONFIG_FLAG.get()
Expand Down
11 changes: 0 additions & 11 deletions ui/src/common/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,6 @@ export interface AdbRecordingTarget extends RecordingTarget {
serial: string;
}

export interface Sorting {
column: string;
direction: 'DESC' | 'ASC';
}

export interface AggregationState {
id: string;
sorting?: Sorting;
}

// Auxiliary metadata needed to parse the query result, as well as to render it
// correctly. Generated together with the text of query and passed without the
// change to the query response.
Expand Down Expand Up @@ -258,7 +248,6 @@ export interface State {
engine?: EngineConfig;
traceUuid?: string;

aggregatePreferences: ObjectById<AggregationState>;
debugTrackId?: string;
lastTrackReloadRequest?: number;
queries: ObjectById<QueryConfig>;
Expand Down
190 changes: 0 additions & 190 deletions ui/src/controller/aggregation/aggregation_controller.ts

This file was deleted.

91 changes: 0 additions & 91 deletions ui/src/controller/trace_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@ import {
WasmEngineProxy,
} from '../trace_processor/wasm_engine_proxy';
import {showModal} from '../widgets/modal';
import {CounterAggregationController} from './aggregation/counter_aggregation_controller';
import {CpuAggregationController} from './aggregation/cpu_aggregation_controller';
import {CpuByProcessAggregationController} from './aggregation/cpu_by_process_aggregation_controller';
import {FrameAggregationController} from './aggregation/frame_aggregation_controller';
import {SliceAggregationController} from './aggregation/slice_aggregation_controller';
import {WattsonEstimateAggregationController} from './aggregation/wattson/estimate_aggregation_controller';
import {WattsonThreadAggregationController} from './aggregation/wattson/thread_aggregation_controller';
import {WattsonProcessAggregationController} from './aggregation/wattson/process_aggregation_controller';
import {WattsonPackageAggregationController} from './aggregation/wattson/package_aggregation_controller';
import {ThreadAggregationController} from './aggregation/thread_aggregation_controller';
import {Child, Children, Controller} from './controller';
import {
FlowEventsController,
Expand Down Expand Up @@ -251,87 +241,6 @@ export class TraceController extends Controller<States> {
Child('flowEvents', FlowEventsController, flowEventsArgs),
);

childControllers.push(
Child('cpu_aggregation', CpuAggregationController, {
engine,
kind: 'cpu_aggregation',
}),
);
childControllers.push(
Child('thread_aggregation', ThreadAggregationController, {
engine,
kind: 'thread_state_aggregation',
}),
);
childControllers.push(
Child('cpu_process_aggregation', CpuByProcessAggregationController, {
engine,
kind: 'cpu_by_process_aggregation',
}),
);
// Pivot table is supposed to handle the use cases the slice
// aggregation panel is used right now. When a flag to use pivot
// tables is enabled, do not add slice aggregation controller.
childControllers.push(
Child('slice_aggregation', SliceAggregationController, {
engine,
kind: 'slice_aggregation',
}),
);
childControllers.push(
Child('counter_aggregation', CounterAggregationController, {
engine,
kind: 'counter_aggregation',
}),
);
if (pluginManager.isActive('org.kernel.Wattson')) {
childControllers.push(
Child(
'wattson_estimate_aggregation',
WattsonEstimateAggregationController,
{
engine,
kind: 'wattson_estimate_aggregation',
},
),
);
childControllers.push(
Child(
'wattson_thread_aggregation',
WattsonThreadAggregationController,
{
engine,
kind: 'wattson_thread_aggregation',
},
),
);
childControllers.push(
Child(
'wattson_process_aggregation',
WattsonProcessAggregationController,
{
engine,
kind: 'wattson_process_aggregation',
},
),
);
childControllers.push(
Child(
'wattson_package_aggregation',
WattsonPackageAggregationController,
{
engine,
kind: 'wattson_package_aggregation',
},
),
);
}
childControllers.push(
Child('frame_aggregation', FrameAggregationController, {
engine,
kind: 'frame_aggregation',
}),
);
childControllers.push(
Child('pivot_table', PivotTableController, {engine}),
);
Expand Down
Loading

0 comments on commit 88ca818

Please sign in to comment.