Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remeh/statsd-zig
Basic statsd implementation in Ziglang.
https://github.com/remeh/statsd-zig
Last synced: 4 months ago
JSON representation
Basic statsd implementation in Ziglang.
- Host: GitHub
- URL: https://github.com/remeh/statsd-zig
- Owner: remeh
- License: mit
- Created: 2020-04-30T20:56:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-28T21:15:00.000Z (about 1 year ago)
- Last Synced: 2024-08-03T23:24:27.142Z (6 months ago)
- Language: Zig
- Size: 104 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-zig - remeh/statsd-zig
README
# statsd-zig
Basic DogStatsD UDP/UDS server supporting gauges and counters and sending these
metrics to Datadog.## Getting started
- `libcurl` must be available on the system
- Build the binary with `zig build` (build with Zig `0.11.0`)
- Set the environment variables `APIKEY` and `HOSTNAME` to configure the daemon### With UDP
- Launch the daemon and start sending it counters and gauges on port udp/8125
### With UDS
- Set the environment variable `UDS` to a filepath of the unix socket you want to use
- Sends counters and gauges on this unix socket with a DogStatsD client## Memory usage
I've developed a custom memory allocator measuring how much memory is allocated
while processing the metrics (see [measure_allocator.zig](https://github.com/remeh/statsd-zig/blob/master/src/measure_allocator.zig)).Using this allocator, the memory is allocated, used, and forgotten for a while.
When the total amount of allocated memory reaches a certain size, it is completely
freed.This provides two benefits:
- close to no time spent freeing memory
- you can easily configure the maximum amount of memory the server can use (set `MAX_MEM_MB`, default value 256)# Author
Rémy 'remeh' Mathieu
# License
This side-project is not endorsed in any way by Datadog.
MIT