Gathering metrics for task executions🔗
In order to get better insight into bottlenecks and consumption of computing
resources Bandsaw provides the
that allows to track metrics like CPU load or memory usage while tasks are executed.
This enables developers to discover hotspots and bottlenecks within their workflow
and identify optimization potential.
The advice uses the
Multimeter library for
collecting the values. It uses the library to write the metrics into a file and
attaches the result under the name 'metrics.
meter is a required positional argument. It contains the pre-configured Multimeter
instance that will be used for measuring the metrics during task execution.
Multimeter is configured by its
In order to gather any value, it must be given atleast 1 probe, e.g.
For more information on how it is being used, please refer to
The directory where the files with the gathered metrics are written to. For each
session a separate file is being created with the name
files are written to the session specific temporary directory.
The file format which is used for writing the results. Multimeter supports multiple
file formats that can be used. Defaults to
For more information refer to
import bandsaw import multimeter from bandsaw.advices.metrics import MetricsAdvice configuration = bandsaw.Configuration().add_advice_chain( MetricsAdvice( multimeter.Multimeter(multimeter.ResourceProbe()), directory='/my/metric/directory', file_format=multimeter.JsonFormat(), ) )