evg-task-profiler-py-0.2.0
توضیحات
-
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | evg-task-profiler-py-0.2.0 |
| نام | evg-task-profiler-py |
| نسخه کتابخانه | 0.2.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | David Bradford <david.bradford@mongodb.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/evg-task-profiler-py/ |
| مجوز | - |
# Evergreen Task Profiler
Break down the runtime of the different steps comprising an evergreen task.
 [](https://pypi.org/project/evg-task-profiler-py/) [](https://github.com/dbradf/evg-task-profiler.py/actions/workflows/CI.yml)
## Installation
Installation is done via pip:
```bash
pip install evg-task-profiler-py
```
## Usage
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](https://github.com/evergreen-ci/evergreen.py)
can be useful for this purpose.
```python
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")
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl evg-task-profiler-py-0.2.0:
pip install evg-task-profiler-py-0.2.0.whl
نصب پکیج tar.gz evg-task-profiler-py-0.2.0:
pip install evg-task-profiler-py-0.2.0.tar.gz