Distributed: Static Performance Report: Allow stacklevel optional argument for gathering source code

Created on 27 Apr 2021  ·  7Comments  ·  Source: dask/distributed

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.

diagnostics

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!

All 7 comments

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 🏎️

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrocklin picture mrocklin  ·  3Comments

quasiben picture quasiben  ·  5Comments

DPeterK picture DPeterK  ·  3Comments

madsbk picture madsbk  ·  4Comments

mrocklin picture mrocklin  ·  4Comments