diff --git a/Cargo.lock b/Cargo.lock index 6d559845..d48f36e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ [root] name = "cernan" -version = "0.1.0" +version = "0.1.3" dependencies = [ "docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)", "histogram 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 402dca79..63c5b1b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cernan" -version = "0.1.2" +version = "0.1.3" authors = ["Brian L. Troutwine "] build = "build.rs" diff --git a/src/metric.rs b/src/metric.rs index 782bc260..d687e3de 100644 --- a/src/metric.rs +++ b/src/metric.rs @@ -72,6 +72,8 @@ mod tests { #[test] fn test_parse_metric_payload() { + assert_eq!(statsd::parse_MetricPayload("foo.bar.99:12.3|ms").unwrap(), + [Metric::new("foo.bar.99", 12.3, MetricKind::Timer)]); assert_eq!(statsd::parse_MetricPayload("foo.bar:12.3|ms").unwrap(), [Metric::new("foo.bar", 12.3, MetricKind::Timer)]); assert_eq!(statsd::parse_MetricPayload("first:1.1|ms\nsnd:2.2|g\n").unwrap(), diff --git a/src/metrics/statsd.lalrpop b/src/metrics/statsd.lalrpop index 1fd746e1..9f8c7fb8 100644 --- a/src/metrics/statsd.lalrpop +++ b/src/metrics/statsd.lalrpop @@ -11,7 +11,7 @@ Kind: MetricKind = { "c@" => MetricKind::Counter(<>), }; -MetricName: String = => String::from_str(s).unwrap(); +MetricName: String = => String::from_str(s).unwrap(); Num: f64 = => f64::from_str(s).unwrap();