Metadata-Version: 2.4
Name: ovperf-collector
Version: 0.5.0
Summary: Low-overhead system metric collection: CPU, memory and GPU as time series, with Nsight helpers
Author: Omniverse Runtime Performance
License-Expression: Apache-2.0
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE-NVTX.txt
License-File: LICENSE-NVML.txt
License-File: LICENSE-MINGW-W64.txt
License-File: LICENSE-LLVM.txt
License-File: third_party/nvtx3/LICENSE.txt
License-File: THIRD-PARTY-NOTICES.txt
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Provides-Extra: parquet
Requires-Dist: pyarrow>=14; extra == "parquet"
Dynamic: license-file

# ovperf-collector

Collect CPU, memory, and GPU metrics as time series, together with application
timings, scopes, and counters.

## What you can do with it

- Sample CPU, memory, and GPU metrics during a recording, or query them once.
- Time blocks of code, mark parts of a run as named sessions, and record your own counters and frame intervals.
- Export samples and summaries as JSON, CSV, or Parquet.
- Correlate measurements with an Nsight Systems capture.
- Use it from Python, or link the C/C++ SDK in the wheel into a native application.

## Install

```bash
python -m pip install ovperf-collector
```

Python 3.10 or later is required. Native collection supports Linux x86-64 and
ARM64 with glibc 2.35 or newer, and Windows 10 or later on x64. GPU metrics
on Linux and Windows require a supported NVIDIA GPU and an installed NVIDIA driver; unavailable
metrics are omitted. The base package has no mandatory Python dependencies.

Releases on PyPI are wheels only, so `pip install` compiles nothing and needs
no compiler, CUDA toolkit or NVIDIA header. On a platform without a wheel, such
as Linux with glibc older than 2.35 (RHEL 9, Amazon Linux 2023, Ubuntu 20.04),
musl-based Linux or Windows on Arm, pip finds no matching distribution.

Starting with 0.5.0, native wheels also support **macOS 15.0 or newer, Apple
silicon (arm64)** with a native arm64 Python. Intel Macs and Rosetta are
unsupported.

Parquet export needs the optional `parquet` extra (`ovperf-collector[parquet]`).

## Quick start

To query the installed collector from a shell:

```bash
ovperf-collector metrics
ovperf-collector snapshot --metric process.memory.rss_bytes --json
ovperf-collector settings --details --json   # Linux
```

The snapshot reads the CLI process's own RSS. Use the Python API inside an application to measure its RSS.

```python
import time
import ovperf_collector as pc

pc.init("my-service")
pc.start_collection()
with pc.scope("step"):
    time.sleep(0.5)  # your work
pc.stop_collection()
pc.export("run.json")
pc.shutdown()
```

This writes `run.json`: the samples of every metric taken during the run, the
duration of `step` as `scope.step.duration_ms`, and a summary of each metric.

## Reference

Everything else is in the `docs/` folder of the package's source; wheels do not
include it. `docs/overview.md` holds the notes on installation, the native SDK,
the native build inputs and known limitations. `docs/usage.md` is the usage
guide, `docs/api.md` the Python API, `docs/native-api.md` and
`docs/native-sdk.md` the C and C++ API and SDK, `docs/platforms.md` platform
support and `docs/metrics.md` the metric catalog. The other documents there
cover metric selection, GPU telemetry, multi-GPU collection, lifecycle,
instrumentation and design. `CHANGELOG.md` lists each release.

## License

The ovperf-collector implementation is licensed under Apache-2.0. Wheels include
license and attribution files for incorporated third-party code and use of the
official NVML build header. The header, NVIDIA driver and
NVML runtime are provided separately and are not bundled with this package.

The wheel's `.dist-info/licenses/THIRD-PARTY-NOTICES.txt` lists the component
attributions. Its `.dist-info/licenses/` directory contains the following notices.
The NVTX headers are in `third_party/nvtx3/` in the build source and in
`ovperf_collector/sdk/source/third_party/nvtx3/` in native wheels; Windows
runtime components are linked into `ovperf_collector/ovperf_collector.dll`.

| Component | Attribution and license | Distributed notice |
| --- | --- | --- |
| NVTX3 | Copyright (c) 2009-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. Apache-2.0 WITH LLVM-exception. | `LICENSE-NVTX.txt`, `third_party/nvtx3/LICENSE.txt` |
| NVML header usage | NVIDIA Corporation; official header used only to build, under the terms reproduced in its notice. | `LICENSE-NVML.txt` |
| MinGW-w64 runtime (Windows only) | MinGW-w64 project, Kai Tietz, Egor Duda, Keith Marshall, David M. Gay and Lucent Technologies; ZPL-2.1, public-domain and the file-specific permissive terms reproduced in the notice. | `LICENSE-MINGW-W64.txt` |
| LLVM compiler-rt builtins (Windows only) | LLVM Project; Apache-2.0 WITH LLVM-exception. | `LICENSE-LLVM.txt` |

Optional Python packages and the NVIDIA driver are installed separately; they
are not included in the wheel. The license files contain the complete terms
and original attributions, including the Windows file-level notices.

## Contributions

This project is currently not accepting contributions.
