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

Make '--output' optional #229

Closed
Nudin opened this issue Mar 8, 2020 · 3 comments
Closed

Make '--output' optional #229

Nudin opened this issue Mar 8, 2020 · 3 comments

Comments

@Nudin
Copy link
Contributor

Nudin commented Mar 8, 2020

When I use py-spy I often forget the output parameter. I also often don't care much about the filename and often it would be nice to know the date of the profile.
We could solve all three "issues" by making the output parameter optional. If not given when calling the profile option py-spy could write the output in a file called '<program_name>-'. (For the case of sampling an already running process we could ether use the pid instead of the program name or query the name of the executable)

Would you accept a PR for this? I would be interested in doing this as a 'first patch' to get some rust-exercise and first step into this awesome tool.

@Nudin
Copy link
Contributor Author

Nudin commented Apr 20, 2020

@benfred: ping – I wouldn't like to start if I don't know your interested in a PR.

@benfred
Copy link
Owner

benfred commented Apr 21, 2020

Thanks @Nudin - I'm definitely interested! Sorry for the delayed response.

Can you make sure to set the extension for the filename appropriately base off the file format (like '.svg' for flamegraph, '.json' for speedscope, '.txt' for raw) ?

Nudin added a commit to Nudin/py-spy that referenced this issue Feb 12, 2021
If no filename is specified by the user it is auto generated from
filename/pid the current time and the appropriate extension.
Nudin added a commit to Nudin/py-spy that referenced this issue Feb 12, 2021
If no filename is specified by the user it is auto generated from
filename/pid the current time and the appropriate extension.
Nudin added a commit to Nudin/py-spy that referenced this issue Feb 12, 2021
If no filename is specified by the user it is auto generated from
filename/pid the current time and the appropriate extension.
Nudin added a commit to Nudin/py-spy that referenced this issue Feb 12, 2021
If no filename is specified by the user it is auto generated from
filename/pid the current time and the appropriate extension.
benfred pushed a commit that referenced this issue Feb 13, 2021
If no filename is specified by the user it is auto generated from
filename/pid the current time and the appropriate extension.
@benfred
Copy link
Owner

benfred commented Mar 21, 2021

Fixed by #229

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

No branches or pull requests

2 participants