pyroscope icon indicating copy to clipboard operation
pyroscope copied to clipboard

Support drag-and-drop for pprof in adhoc mode

Open Rperry2174 opened this issue 4 years ago • 1 comments

Currently in adhoc mode there is the ability to drag and drop a JSON file and see the resulting flamegraph. However, currently dragging and dropping a pprof file is not supported 2022-01-27 15 53 27

We should add support for this where the flow from a UX perspective is exactly the same. There will have to be some use of the backend.

Rperry2174 avatar Feb 01 '22 07:02 Rperry2174

I think the following approach would work best to support D&D for external formats (both pprof and collapsed):

  • When a file is D&D, the file uploader uploads the file to the /api/adhoc/v1/upload endpoint.
  • The API endpoint returns a profile in native JSON format if possible, or an error otherwise.

This will cover both the single and comparison views. For diff view, we need a bit of additional work:

  • Once we have both base and diff profiles (either from the file selector or from file upload, following the procedure described above), the adhoc diff component uploads both profiles to the /api/adhoc/v1/upload-diff endpoint.
  • The API endpoint returns a diff profile in native JSON if possible, or an error otherwise.

abeaumont avatar Feb 14 '22 14:02 abeaumont