Loading Indicator

31 views
Skip to first unread message

Felix Geisendörfer

unread,
Dec 14, 2022, 12:00:05 PM12/14/22
to perfet...@googlegroups.com, Nick Ripley
Hi,

we're working on integrating Go's runtime/trace execution tracer from the old catapult UI to Perfetto (see tracking issue) and running into a small problem:
  1. The user clicks a link "open in Perfetto".
  2. Our onClick handler calls window.open() to establish the deep linking with Perfetto UI. This has to be done right away to avoid popup blocking from the browser.
  3. Then we call fetch() to get the data for perfetto, but this process can take 20s.
  4. Meanwhile the Perfetto UI is open and the user has no indication that the data is being loaded in the background.
  5. Eventually the fetch() operation finishes, and we call postMessage() which causes Perfetto to show a loading indicator.
I have recorded a short video showing the problem here: https://a.cl.ly/4gu49ggL

What we would like is the ability to tell Perfetto to start showing a loading indicator immediately, perhaps via a separate postMessage(). This way the user would not be confused about what's going on.

Please let us know if this is something that Perfetto could support in the future, or if you have another idea on how we could provide a better user experience right now.

Of course we'd like to speed up the trace data generation as well, but it's not easy.

Thanks
Felix Geisendörfer (on behalf of the go runtime diagnostics working group)


Lalit Maganti

unread,
Dec 14, 2022, 12:13:52 PM12/14/22
to Felix Geisendörfer, perfet...@googlegroups.com, Nick Ripley
Hi there,

A simple suggestion would be to have two links: the first link, you just generate the trace and when that's ready, you show the second link (or change the first one) to actually post the data to the UI.

Certainly adding support for progress indication on the UI for the postMessage API would be very much possible: realistically though, this would be a low priority thing for us so it's unlikely we would get to this any time soon with the limited bandwidth we have. However, contributions are welcome and we'd be happy to guide anyone who would want to implement this feature.

Thanks,
Lalit

--
You received this message because you are subscribed to the Google Groups "Perfetto Development - www.perfetto.dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to perfetto-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/perfetto-dev/CAJ1-RfU2zbGyF6xsX52jhHYxDLsy%2BsJeM5UuoRuRgdx1W0jo1g%40mail.gmail.com.

Felix Geisendörfer

unread,
Dec 14, 2022, 3:22:33 PM12/14/22
to Lalit Maganti, perfet...@googlegroups.com, Nick Ripley
Hi Lalit,

Thanks for the quick reply!


On Wed, Dec 14, 2022 at 6:13 PM Lalit Maganti <lal...@google.com> wrote:
A simple suggestion would be to have two links: the first link, you just generate the trace and when that's ready, you show the second link (or change the first one) to actually post the data to the UI.

We considered the two-link solution you suggested, but felt it was solving one problem, but creating another one (two clicks needed instead of one).

But maybe we need to reconsider it. It's probably still better than expecting the user to wait for 20s without feedback. Many people may already give up and assume the feature is broken.
 
Certainly adding support for progress indication on the UI for the postMessage API would be very much possible: realistically though, this would be a low priority thing for us so it's unlikely we would get to this any time soon with the limited bandwidth we have. However, contributions are welcome and we'd be happy to guide anyone who would want to implement this feature.

It's great to hear that you'd be willing to accept such a feature as a contribution. We might go with the two-link solution for now, but I could see us coming back to this with a patch for at some point next year :).

Cheers
Felix

PS: Thanks for Perfetto - it's really awesome :).

Felix Geisendörfer

unread,
Dec 15, 2022, 4:20:08 AM12/15/22
to Lalit Maganti, perfet...@googlegroups.com, Nick Ripley
Hi Lalit,

Thanks again. I went ahead and implemented a solution that loads the trace without opening perfetto ui yet. It then tries to open perfetto, but also adds a link to manually open it in case the auto-open fails due to popup blocking (after ~3-5s in chrome?).

You can see a link to the code and some videos of it in action here: https://github.com/golang/go/issues/57315 

Cheers
Felix
Reply all
Reply to author
Forward
0 new messages