https://github.com/codspeedhq/instrument-hooks
Internal core for the codspeed instruments
https://github.com/codspeedhq/instrument-hooks
benchmarking codspeed
Last synced: 4 months ago
JSON representation
Internal core for the codspeed instruments
- Host: GitHub
- URL: https://github.com/codspeedhq/instrument-hooks
- Owner: CodSpeedHQ
- License: apache-2.0
- Created: 2025-04-15T16:25:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-15T17:40:20.000Z (5 months ago)
- Last Synced: 2026-01-15T20:16:00.920Z (5 months ago)
- Topics: benchmarking, codspeed
- Language: C
- Homepage: https://codspeed.io/
- Size: 575 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
instrument-hooks
[](https://github.com/CodSpeedHQ/instrument-hooks/actions/workflows/ci.yml)
[](https://discord.com/invite/MxpaCfKSqF)
Zig library to control instrumentations via IPC.
## Requirements
- **Zig**: 0.14
- [**Just**](https://github.com/casey/just) (optional): To easily run the build, formatter or tests
## How to add new integration?
This library is intended to be used as a C library. The main source file is in `dist/core.c` and the headers are in `includes/`. See `examples/main.c` for an example on how to use it.
To test if it worked, call `is_instrumented` which should return `false` when running without Codspeed. To run with Codspeed, execute the following:
```
codspeed run --
```
To make sure your integration is fully working, you have to implement all these hooks:
- start_benchmark: Call this when the benchmark starts, to start measuring the performance.
- stop_benchmark: Stop measuring the performance after the benchmark stopped.
- set_executed_benchmark: Provide metadata about which benchmark was executed.
- set_integration: Provide metadata about the integration.
## Run tests
```
zig build test --summary all
```
or
```
just test
```