google / google/perfetto

ui: support instantiation of the UI on multiple loaded traces simultaneously

Open
#2,336 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
6.5k
Forks
868
Avg merge
2d 1h
Merged PRs (30d)
218

Description

Perfetto UI currently presents a single loaded trace at any time. When a trace is loaded, any previously open trace is disposed.

I am building an application that runs and collects Perfetto trace data from multiple applications and does so in an iterative process, in which I need to be able to present multiple loaded traces to the user at one time. And, of course, my application wants to use the Perfetto UI that is so well suited to this task.

So, it would be great if the UI could support a mode of operation in which

- the `AppImpl` maintains any number of loaded `TraceImpl`s at any time
- the `UiMain` and/or components thereof (perhaps just individual pages such as the Viewer page and Trace Info page) is parameterized with the `TraceImpl` to present and thus could be instantiated multiple times in the DOM for different traces
- all UI components at all levels of the UI structure have the trace injected into them that they need to present, rather than relying on the currently open trace known via the `AppImpl` singleton

Of course, it would be up to embedder applications such as mine to determine when and where in the DOM to instantiate the UI for any given trace, and also when to unload a trace and dispose of any registrations or other book-keeping associated with it.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how AppImpl owns the current TraceImpl and how UiMain and the Viewer and Trace Info pages obtain it. Map the lifecycle and registrations that are disposed when a trace is replaced. Done means multiple TraceImpl instances can be presented simultaneously, with UI components receiving the intended trace and embedders able to unload one cleanly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.