Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

appsignal/statsd_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

25 Commits

Repository files navigation

(Dog)statsD Parser

Build Status Crate

Parses (Dog)StatsD strings and returns a normalized struct.

All standard StatsD metric types are implemented. For DogStatsD sample rates and tags are implemented.

use statsd_parser;
#[test]
fn test_statsd_counter_with_sample_rate_and_tags() {
 let mut tags = BTreeMap::new();
 tags.insert("foo".to_string(), "bar".to_string());
 tags.insert("moo".to_string(), "maa".to_string());
 let expected = Metric::Counter(Counter {
 name: "gorets".to_string(),
 value: 1.0,
 sample_rate: Some(0.9),
 tags: Some(tags)
 });
 assert_eq!(parse("gorets:1|c|@0.9|#foo:bar,moo:maa"), Ok(expected));
}

License

Licensed under either of

at your option.

Contribution

Contributions are very welcome. Please make sure that you add a test for any use case you want to add.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

(Dog)StatsD parser written in Rust

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /