1/efoppiano/zig-statsd-client v0.1

A client implementation of StatsD in Zig


Zig StatsD

A client implementation of StatsD in Zig.

Using the library

Copy the src/statsd_client.zig file into your project and import it

const StatsDClient = @import("statsd_client.zig").StatsDClient;
var client = try StatsDClient.init(.{.host="127.0.0.1", .port=8125, .prefix="my_app"});

Sending metrics

// Increment a metric by 1
client.incr("my.counter");

// Decrement a metric by 1
client.decr("my.counter");

// Update a gauge to 42
client.gauge("my.gauge", 42.0);

// Increment a gauge by 2
client.gauge_incr("my.gauge", 2.0);

// Send a timer of 15 ms
client.timer("my.timer", 15.0);

Compatibility

This library is compatible with Zig 0.13.0

License

Licensed under the MIT License.

Package Contents

  • LICENSE
  • build.zig
  • zigmod.yml
  • src/statsd_client.zig
  • src/tests.zig
  • README.md
  • .gitignore

History

Published On Tree @ Commit Size
v0.1 Sat, 14 Sep 2024 18:33:56 UTC Tree 14.717 KB