Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiemontese committed Nov 25, 2024
1 parent 37ac847 commit 720d546
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.9.0] - 2024-11-25

### Added

- New `event_with_options!` macro, [see the original repo](https://github.com/mcasper/dogstatsd-rs) for more details

### Changed

- Bump `dogstatsd` to 0.12
- Bumped MSRV to 1.74

---

Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
//! service_check!("test", ServiceStatus::OK, ServiceCheckOptions::default());
//! # event!("test", "test event");
//! event!("test", "test event"; "some" => "data");
//! # event_with_options!("test", "test event", EventOptions::new());
//! event_with_options!("test", "test event", EventOptions::new(); "some" => "data");
//! ```
//!
//! This is an example of a custom metric, in this case based on an enum type, but it can really be
Expand Down
8 changes: 8 additions & 0 deletions src/tests/event_with_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,18 @@ pub fn test_macro() {
let tag = String::from("tag");
// no tags
event_with_options!("test", "test_value");
// no tags with options
event_with_options!("test", "test_value", EventOptions::new());
// just literal tags
event_with_options!("test", "test_value"; "literal" => 1);
// just literal tags with options
event_with_options!("test", "test_value", EventOptions::new(); "literal" => 1);
// just expression tags
event_with_options!("test", "test_value"; "expression" => tag);
// just expression tags with options
event_with_options!("test", "test_value", EventOptions::new(); "expression" => tag);
// mixed tags
event_with_options!("test", "test_value"; "literal" => 1, "expression" => tag);
// mixed tags with options
event_with_options!("test", "test_value", EventOptions::new(); "literal" => 1, "expression" => tag);
}

0 comments on commit 720d546

Please sign in to comment.