Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Add the dependency:
statshouse = "0.1.0"
```

Send a counter metric:
Send a counter metric (UDP by default):

```rust
use statshouse::{MetricBuilder, Transport};
Expand All @@ -30,13 +30,13 @@ fn main() {
}
```

Send value metric:
Send value metric over TCP:

```rust
use statshouse::{MetricBuilder, Transport};

fn main() {
let mut transport = Transport::new("127.0.0.1:13337");
let mut transport = Transport::tcp("127.0.0.1:13337");

MetricBuilder::new(b"latency_ms")
.tag(b"env", b"staging")
Expand All @@ -45,10 +45,29 @@ fn main() {
}
```

Use UDP explicitly:

```rust
use statshouse::{MetricBuilder, Transport};

fn main() {
let mut transport = Transport::udp("127.0.0.1:13337");

MetricBuilder::new(b"requests_total")
.tag(b"env", b"staging")
.write_count(&mut transport, 1.0, 0);
}
```

## Development

Single command to run all checks: `cargo x ci`

## License

MPL-2.0

## TODO

- Align `__src_client_write_err` tags with Go (env/app tags).
- Re-resolve TCP addresses and retry queued batches on reconnect to match Go behavior.
Loading