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

View File

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

View File

@ -1,5 +1,5 @@
use super::histogram::HistogramSnapshot; use super::histogram::HistogramSnapshot;
use metrics_core::{Snapshot as MetricsSnapshot, Recorder}; use metrics_core::{Recorder, Snapshot as MetricsSnapshot};
use std::fmt::Display; use std::fmt::Display;
/// A typed metric measurement, used in snapshots. /// 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]) { 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"))] #[cfg(any(feature = "metrics-exporter-log"))]
pub mod exporters; 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 mod recorders;
pub use self::{ pub use self::{