Adding new performance histograms for performance tool launch
Adding new performance histograms for performance tool launch

This change adds 1 new performance histogram for the DevTools using the
prefix 'DevTools.Launch':
- DevTools.Launch.Timeline

This histogram measure the time between the DevTools window being
shown during 'DevToolsWindow::ToggleDevToolsWindow' and a point in each
tool that corresponds to the 'ready' state as seen by a user. These end
points are unique to each tool but are as follows:
- Performance: After the panel is shown

This histogram will allow us to identify any significant performance impact
in the time taken to launch the DevTools when these panels open by
default.

To see time captured by the histograms in terms of a perf trace for
each tool please take a look at the following screenshots:
https://imgur.com/a/iRCkSwP

In the traces you can see that the end marker for each load is at the
end of the trace near first meaningful paint, and just as the user
will see the content of the tool render fully.


When the frontend javascript loads, it will store the initial panel to
be loaded from the preferences. Once that panel has been created and
the appropriate loaded marker has been hit, the duration of the launch
will be calculated using performance.now(). That duration is then sent
to the native code which will fire the appropriate histogram via the
'UMA_HISTOGRAM_TIMES' macros.

The mechanism is similar to the existing one used for enumerated
histograms and can be expanded to fire additional performance histograms
in the future.

Also added a new test for user-metrics to ensure that the panelLoaded
function will correctly record the histograms.

Change-Id: I495bde02dcfb66959cabce2c9c905b221355c91a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1986208
Commit-Queue: Alex Chiem <1d1806554add5cda0f2dc8e77a80ec2655520a51@microsoft.com>
Reviewed-by: Robert Paveza <7787129de3d0cb4911c68d958db3023863584560@microsoft.com>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend