Bump metrics to 0.9.1

This commit is contained in:
Toby Lawrence 2019-05-01 11:47:17 -04:00
parent bef5daa908
commit cd03b1e613
No known key found for this signature in database
GPG Key ID: 3BB201B0EEE9212E
4 changed files with 17 additions and 17 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "metrics"
version = "0.9.0"
version = "0.9.1"
authors = ["Toby Lawrence <toby@nuclearfurnace.com>"]
edition = "2018"
@ -35,9 +35,9 @@ hashbrown = "^0.1"
quanta = "^0.2"
futures = "^0.1"
tokio-sync = "^0.1"
metrics-exporter-log = { path = "../metrics-exporter-log", version = "^0.1", optional = true }
metrics-recorder-text = { path = "../metrics-recorder-text", version = "^0.1", optional = true }
metrics-recorder-prometheus = { path = "../metrics-recorder-prometheus", version = "^0.1", optional = true }
metrics-exporter-log = { path = "../metrics-exporter-log", version = "^0.2", optional = true }
metrics-recorder-text = { path = "../metrics-recorder-text", version = "^0.2", optional = true }
metrics-recorder-prometheus = { path = "../metrics-recorder-prometheus", version = "^0.2", optional = true }
[dev-dependencies]
log = "^0.4"

View File

@ -1,9 +1,9 @@
use super::data::snapshot::Snapshot;
use crossbeam_channel::{bounded, Sender};
use futures::prelude::*;
use metrics_core::{AsyncSnapshotProvider, SnapshotProvider};
use std::error::Error;
use std::fmt;
use metrics_core::{SnapshotProvider, AsyncSnapshotProvider};
use futures::prelude::*;
use tokio_sync::oneshot;
/// Error conditions when retrieving a snapshot.
@ -16,18 +16,13 @@ pub enum SnapshotError {
ReceiverShutdown,
}
impl Error for SnapshotError {
}
impl Error for SnapshotError {}
impl fmt::Display for SnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
SnapshotError::InternalError => {
write!(f, "internal error while collecting snapshot")
},
SnapshotError::ReceiverShutdown => {
write!(f, "receiver is shutdown")
},
SnapshotError::InternalError => write!(f, "internal error while collecting snapshot"),
SnapshotError::ReceiverShutdown => write!(f, "receiver is shutdown"),
}
}
}

View File

@ -1,5 +1,5 @@
use super::histogram::HistogramSnapshot;
use metrics_core::{Snapshot as MetricsSnapshot, Recorder};
use metrics_core::{Recorder, Snapshot as MetricsSnapshot};
use std::fmt::Display;
/// A typed metric measurement, used in snapshots.
@ -122,7 +122,9 @@ mod tests {
}
fn record_histogram<K: AsRef<str>>(&mut self, key: K, values: &[u64]) {
let _ = self.histogram.insert(key.as_ref().to_owned(), values.to_vec());
let _ = self
.histogram
.insert(key.as_ref().to_owned(), values.to_vec());
}
}

View File

@ -124,7 +124,10 @@ mod sink;
#[cfg(any(feature = "metrics-exporter-log"))]
pub mod exporters;
#[cfg(any(feature = "metrics-recorder-text", feature = "metrics-recorder-prometheus"))]
#[cfg(any(
feature = "metrics-recorder-text",
feature = "metrics-recorder-prometheus"
))]
pub mod recorders;
pub use self::{