Page MenuHomePhabricator

Make --xprofile upload to XHProf
Open, Needs TriagePublic

Description

99% of the time when I am using the --xprofile flag, I do the following:

  1. Run some_command.PHP --xprofile=profile.json.
  2. Upload the profile to Phabricator with arc upload profile.json.
  3. Get the PHID of the newly uploaded file with echo '{"names": ["F123"]}' | arc call-conduit 'phis.lookup'.
  4. Open a browser and load https://phabricstor.mydomain.com/xhprof/profile/$PHID/.

This is very tedious and hard to explain to other... Instead I propose that the --xprofile flag automatically uploads the profile to Phabricator and provides an XHProf link to the profilem

Event Timeline

joshuaspence updated the task description. (Show Details)
joshuaspence added projects: Arcanist, XHProf.
joshuaspence updated the task description. (Show Details)
joshuaspence updated the task description. (Show Details)
joshuaspence added a subscriber: joshuaspence.

I think --xprofile is provided by libphutil but it doesn't know about Phabricator. It seems sort-of-nice-to-have to have the raw version, maybe. Not sure how easy it is to add --upload-xprofile to arc.

We could also add an arc upload-profile <file> or whatever, conceivably. This wouldn't be quite as seamless but we could add stuff like arc upload-profile --browse <file> more easily than --upload-xprofile --after-uploading-profile-browse-that-profile.

Not sure if it would be desirable but perhaps Arcanist would override libphutil's --xprofile and wrap around it to provide the suggested functionality? This is probably too magical. arc --upload-xprofile seems reasonable.

It seems sort-of-nice-to-have to have the raw version, maybe.

Personally, I've never had a need for the raw file.

--upload-xprofile is definitely more useful overall than --xprofile <file> since 99% of the time I've also done some approximation of that upload dance, it just feels a little weird for some stuff to take --xprofile <file> and some stuff to take --xprofile which takes no argument and means something completely different.

(We could also reasonably rename --xprofile to --xprofile-outfile or something, so the more-useful option can own the shorter flag.)

epriestley moved this task from Backlog to Upstream on the Arcanist board.Sep 27 2018, 3:17 PM