Allow the user to specific which level of the call stack is used for capturing source code in the static report generated by dask.distributed.performance_report. In some cases, the method might be wrapped by another function so allowing users to ability to select which level to include in the report might be helpful to them.
with dask.distributed.performance_report(filename=filename, stacklevel=2):
...
I am happy to pick this up as I'm working on related functionality.
I'm slightly conflicted work-wise, but this seems fine to me. I think that the use of the stacklevel= keyword name is nice because it matches existing Python API with warnings.warn
This seems reasonable to me, but I have a similar conflict. @quasiben would this be useful for any of the RAPIDS folks? You and your group seem to produce a lot of performance_reports
Conflicted meaning it is useful for other work projects or something else?
Anyways I don't see any issue with this. People frequently are interested in recommendations on how to profile in a distributed setting. Continuing to improve our tooling on this front makes sense to me
Conflicted meaning that both James and I work for Coiled, and this is necessary for internal Coiled work. This seems pretty innocuous, but we'd feel more comfortable giving the green light if some non-Coiled person signed off on it. I think that @jakirkham 's comment does that. Thanks!
I am happy to pick this up as I'm working on related functionality
Woo! @ndanielsen a PR adding stacklevel= would be very welcome
Sorry to be late here. This seems like a solid improvement for everyone +1
@jrbourbeau I just put a PR up for this. Thanks for the go ahead 🏎️
Most helpful comment
Conflicted meaning that both James and I work for Coiled, and this is necessary for internal Coiled work. This seems pretty innocuous, but we'd feel more comfortable giving the green light if some non-Coiled person signed off on it. I think that @jakirkham 's comment does that. Thanks!