pasteur.utils.perf.PerformanceTracker#
- class pasteur.utils.perf.PerformanceTracker[source]#
Tracks code performance by hooking to Pasteur internals and logs to mlflow.
Works similar to logging loggers. Grab the tracker with the appropriate name with get(), log various operations in the module by calling start(), stop(), and have them logged as <perf>.<tracker>.<name>.
For multistep tracking, call ensemble() with the name of the multistep tracking operation and the steps it depends on.
Example: ```python t = PerformanceTracker.get(“synth”) t.ensemble(“total”, “bake”, “fit”, “sample”)
t.start(“bake”) # bake… t.stop(“bake”)
t.start(“fit”) # fit… t.stop(“fit”)
t.start(“sample”) # sample… t.stop(“sample”) ```
Logs:
` perf.synth.bake = ... perf.synth.fit = ... perf.synth.sample = ... perf.synth.total = ... `Methods