Add zoom/trim/pan functionality to see details in a long benchmark
It's pretty common for interfaces like this to have a feature where you can select a snippet of the timeline and "zoom in" on it. Y axis stays the same, X axis increases scale so details can be seen.
It's something users will probably expect based on experience with dev tools and similar, and seems like an important feature since Doctor can run for any time period: run it for longer than, say, 20 seconds, and (depending on screen size) events become hard to distinguish. It would also enable other potential enhancements such as loading and comparing different benchmarks on the same scale.
Should be animated so the user can clearly see what is happening as the x-axis stretches (or on zoom out, contracts) and finer-grain X-axis ticks appear (or disappear).
I like Andreas's approach of using event emitters to separate actions from the UI, I'd suggest we do it in two steps to avoid getting bogged down in UI design detail questions before we're in a good position to test ideas out:
- Implement a callable event like
scaleXAxis( startTimestamp, endTimestamp, duration )(duration uses default setting if unset, can be 0 for instant). This can be done before / while we make decisions on the UI and would make it easy to compare and test UI options. - Add UI for this e.g. drag to select a region to zoom in on, some intuitive way to cancel a zoom, click to auto-zoom on the the highlighted problem area, etc.
I like the idea, especially the part about zooming in on the detected interval. For slow users, this can be only 10% of the total data. However, it is the only relevant 10%.
We need to think about how long we could make doctor run. The interval detection algorithm is O(n^2) so there is definitely a limitation.
edit: your separation approach is good.
This limitation should be written in the README of the tool (and maybe also in clinic).
+1 on the idea.
PS: i was actually thinking of a faster approximation algorithm that uses a FFT and Sinc curve-fit :p – That should be O(n log(n)^2).
I do not see the zoom needed for launch, but it would be nice to have.
This could likely be looked at again. Doctor is out quite some while.
There's some ongoing work around the upper size limits for Clinic profiles, I think it'd make sense to revisit this after that when we know what are the largest / longest profiles we intend to reasonable support.
This is a feature that every Clinic tool could use (Doctor, Bubbleprof and Flame) so I think after we've got some certainty on upper limits and completed other high priority long tasks (e.g. Clinic Flame redesign) we should set aside a little time to implement this feature consistently in all three tools.