perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

Add UI control over only rendering flow one step forward

Open ManiacLook opened this issue 1 year ago • 8 comments

Hello, I have noticed an issue. There are three slices. Slice 1 has track_event.flow_ids as [1], slice 3 has track_event.flow_ids as [2], and slice 2 has track_event.flow_ids as [1, 2]. When I click on slice 1 with my mouse, based on my understanding, the arrow between slice 2 and slice 3 should not appear, but it does. Additionally, the arrow on the left is thicker, while the arrow on the right is thinner. Is this intended by design? If I want to hide the arrow on the right, is it possible to achieve that?

example UI: Image

ManiacLook avatar Feb 05 '25 09:02 ManiacLook

When I click on slice 1 with my mouse, based on my understanding, the arrow between slice 2 and slice 3 should not appear, but it does.

We render all flows in the chain, meaning we follow the chain of all flows connected to each slice forward and backward regardless of the flow id they belong to. Flow ids as they exist currently are really just a mechanism for defining how slices are connected together in the TrackEvent proto, and have no meaning in the UI.

Note: The original flow id is actually available to the UI. If you run the query select * from flows you can see the original flow id from the trace in the trace_id column, but we currently don't do anything with it.

Additionally, the arrow on the left is thicker, while the arrow on the right is thinner. Is this intended by design?

This is by design. Flows directly connected to the selected slice are rendered with a thicker line than flows connected to other slices in the chain.

If I want to hide the arrow on the right, is it possible to achieve that?

It don't believe it's possible currently without modifying the UI. As long as Slice 2 has an incoming and outgoing flow, both will be rendered.

stevegolton avatar Feb 05 '25 11:02 stevegolton

Yes I think this is a actually a feature rather than a bug. Maybe we can add an option to only show direct flows but I think it's so far down the priority list I doubt we'll ever get to it.

LalitMaganti avatar Feb 05 '25 11:02 LalitMaganti

I'm working with a trace that has thousands of flows (a trace of a build that encodes dependencies between build actions as flows), and this behavior makes the UI grind to a halt trying to render all of the flows in the chain :(

Can we please have an option to only show direct flows?

Image

BGR360 avatar Jun 18 '26 01:06 BGR360

I appreciate the pain of not being able to open traces you control: while technically simple to implement what you ask for, it's one of those annoying things to think about UX wise. I'll discuss with Steve if there's some good way we can do this.

LalitMaganti avatar Jun 18 '26 09:06 LalitMaganti

Re: the new title. In my case I only want to see one step "backward" in the flow chain as well, not just one step "forward."

it's one of those annoying things to think about UX wise.

Totally. I don't know what your guiding principles are for UX, but here's an idea that would feel intuitive to me as a user: add some sort of toggle to both the "Preceding Flows" and "Following Flows" to individually turn on and off predecessor and successor flows:

Image

I imagine the UI would remember your selection from the last slice you selected and apply the same config next time you click on a slice.

BGR360 avatar Jun 18 '26 21:06 BGR360

Checking in on this, wanted to know if there was any satisfying UX answer here. If so, I could put this on my backlog to address in a PR.

BGR360 avatar Aug 31 '26 19:08 BGR360

@stevegolton is the one to comment here. I don't think we came up with a good answer in our discussions.

LalitMaganti avatar Aug 31 '26 19:08 LalitMaganti

I decided to take a stab at this - https://github.com/google/perfetto/pull/7296

UX wise, the easiest thing to do was make this a setting. The preceding flows/following flows UI panel and the timeline arrows are rendered from completely different plugins so technically it's tricky to put the checkbox there - I think the setting is a rational compromise is we want to just get something working.

It should be running through the CI, which should post a link to the UI build in a comment shortly. Let me know what you think @BGR360

Edit:

  • You can find the build here: https://storage.googleapis.com/perfetto-ci-artifacts/gh-33537450504-1-ui/ui/index.html
  • Direct link to the setting: https://storage.googleapis.com/perfetto-ci-artifacts/gh-33537450504-1-ui/ui/index.html#!/settings/dev.perfetto.DirectFlowsOnly

stevegolton avatar Sep 01 '26 17:09 stevegolton