Break down the runtime of the different steps comprising an evergreen task.
Installation is done via pip:
pip install evg-task-profiler-py
An example of usage is shown below. Note: You will need to retrieve the task log contents and send it to the profiler, a tool like the Evergreen API client can be useful for this purpose.
from evergreen import EvergreenApi
from evg_task_profiler_py import TaskProfiler
task_id = "some_evg_task_id"
evg_api = EvergreenApi.get_api(use_config_file=True)
profiler = TaskProfiler()
task = evg_api.task_by_id(task_id)
for line in task.stream_log("task_log"):
profiler.process_line(line)
for event in profiler.get_events():
print(f"{event.index}: {event.name} - {event.step}: {event.duration} ms")