Bumped to 0.7.8, changes, fix EOL prometheus

This commit is contained in:
Francis Lalonde 2019-06-21 20:55:11 -04:00
parent 18457a792d
commit 622c3ba667
3 changed files with 6 additions and 51 deletions

View File

@ -1,5 +1,9 @@
# Latest changes + history
## version 0.7.8
- Fixed Prometheus output https://github.com/fralalonde/dipstick/issues/70
## version 0.7.6
- Move to Rust 2018 using cargo fix --edition and some manual help
- Fix nightly's 'acceptable regression' https://github.com/rust-lang/rust/pull/59825
- Give each flush listener a unique id

View File

@ -77,7 +77,7 @@ To use Dipstick in your project, add the following line to your `Cargo.toml`
in the `[dependencies]` section:
```toml
dipstick = "0.7.7"
dipstick = "0.7.8"
```
## External features

View File

@ -126,6 +126,7 @@ impl PrometheusScope {
strbuf.push(' ');
}
strbuf.push_str(&value_str);
strbuf.push('\n');
let mut buffer = self.buffer.borrow_mut();
if strbuf.len() + buffer.len() > BUFFER_FLUSH_THRESHOLD {
@ -138,11 +139,6 @@ impl PrometheusScope {
buffer = self.buffer.borrow_mut();
}
if !buffer.is_empty() {
// separate from previous entry
buffer.push('\n')
}
buffer.push_str(&strbuf);
if !self.is_buffered() {
@ -212,48 +208,3 @@ impl Drop for PrometheusScope {
}
}
}
//#[cfg(test)]
//mod test {
// use super::*;
// use crate::core::input::InputKind;
// use std::io;
// use crate::core::input::Input;
// use crate::core::input::InputScope;
//
// #[test]
// fn sink_print() {
// let sd = Prometheus::push_to("localhost:2003").unwrap().metrics();
// let timer = sd.new_metric("timer".into(), InputKind::Counter);
// sd.write(33, labels![]);
// }
//}
//#[cfg(feature = "bench")]
//mod bench {
//
// use super::*;
// use crate::core::attributes::*;
// use crate::core::input::*;
//
// #[bench]
// pub fn immediate_prometheus(b: &mut test::Bencher) {
// let sd = Prometheus::push_to("localhost:2003").unwrap().metrics();
// let timer = sd.new_metric("timer".into(), InputKind::Timer);
//
// b.iter(|| test::black_box(timer.write(2000, labels![])));
// }
//
// #[bench]
// pub fn buffering_prometheus(b: &mut test::Bencher) {
// let sd = Prometheus::push_to("localhost:2003")
// .unwrap()
// .buffered(Buffering::BufferSize(65465))
// .metrics();
// let timer = sd.new_metric("timer".into(), InputKind::Timer);
//
// b.iter(|| test::black_box(timer.write(2000, labels![])));
// }
//
//}