Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --json format #103

Merged
merged 1 commit into from
Jan 6, 2019
Merged

Add --json format #103

merged 1 commit into from
Jan 6, 2019

Conversation

palkan
Copy link
Contributor

@palkan palkan commented Oct 26, 2018

Add --json output to stack prof CLI.

The generated output could be used with web viewers (e.g. I want to use it with
https://www.speedscope.app/ – yeah, I've noticed that there is a PR to add out-of-the-box speedscope support; but who knows which flame graph viewer will rock in a year or two?).

Copy link
Contributor

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally like this (not that I have too much sway), since it isn't really destructive to what is already there, and very simply adds support for speedscope as well.

Tried it out (effectively... I just did a JSON.generate report.dump on a report I was already working with) and it works in the speedscope.app just fine.

@@ -1,5 +1,6 @@
require 'pp'
require 'digest/md5'
require 'json'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move this into the print_json method so we are only requiring JSON when we are using it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep; makes sense.

Done

@jlfwong
Copy link
Collaborator

jlfwong commented Jan 5, 2019

Sweet! I would love to get #100 merged, but this seems like a reasonable stop-gap to me!

I'm in an awkward position of technically having merge rights granted in this repository, but not rubygem publish rights, and also I'm not predominately a ruby dev.

@tenderlove any chance you have time to look at this and/or #100?

@tenderlove tenderlove merged commit 81da767 into tmm1:master Jan 6, 2019
@palkan palkan deleted the feature/print-json branch January 6, 2019 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants