bloomberg / pytest-memray

pytest plugin for easy integration of memray memory profiler
https://pytest-memray.readthedocs.io/en/latest/
Apache License 2.0
353 stars 25 forks source link

Enable more reporters as pytest options #39

Closed thomasfinstad closed 2 years ago

thomasfinstad commented 2 years ago

Feature Request

I would like a flamegraph generated when pytest runs.

It would be very handy if this could be done automatically by configuring the flamegraph report options as parameters or in pytest.ini. Same goes for other "non-live" reporters eg: table, tree, stats, etc

Saving the bin files and generate flamegraph afterwards, but this would require changes to build steps, not just pytest config.

A simple "proxy" of the reporters config parameters should be good enough, maybe prefixed with memray or memray-<reporter>, eg: memray-flamegraph-output = my-output-file

gaborbernat commented 2 years ago

We've generally decided against such functionality (as they are many dumps here, not just one, so we'd potentially generate a lot of reports that you don't always want) and instead went with allowing you to save the dumps (and then you can use memray itself to generate custom reports). See PR https://github.com/bloomberg/pytest-memray/pull/14 and issue https://github.com/bloomberg/pytest-memray/issues/10 where this feature has been added.