Skip to content

Commit

Permalink
expand serde coverage for histogram crate (#107)
Browse files Browse the repository at this point in the history
Expands serde coverage for histogram crate.

Updates ringlog to use latest metriken version.
  • Loading branch information
brayniac authored Feb 7, 2024
1 parent 9a9b9bd commit 039544c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion histogram/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "histogram"
version = "0.9.0"
version = "0.9.1"
edition = "2021"
authors = ["Brian Martin <brian@pelikan.io>"]
license = "MIT OR Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions histogram/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::time::SystemTime;

/// A snapshot of a histogram across a time range.
#[derive(Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Snapshot {
// note: `Histogram` contains the start time
pub(crate) end: SystemTime,
Expand Down
5 changes: 1 addition & 4 deletions histogram/src/sparse.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

use crate::{Bucket, Config, Error, Histogram, Snapshot};

/// This histogram is a sparse, columnar representation of the regular
Expand All @@ -10,7 +7,7 @@ use crate::{Bucket, Config, Error, Histogram, Snapshot};
/// of non-zero buckets. Assuming index[0] = n, (index[0], count[0])
/// corresponds to the nth bucket.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
pub struct SparseHistogram {
/// parameters representing the resolution and the range of
Expand Down
1 change: 1 addition & 0 deletions histogram/src/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::time::SystemTime;

/// A histogram that uses plain 64bit counters for each bucket.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Histogram {
pub(crate) config: Config,
pub(crate) start: SystemTime,
Expand Down
4 changes: 2 additions & 2 deletions ringlog/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ringlog"
version = "0.5.0"
version = "0.6.0"
edition = "2021"
license = "Apache-2.0"
authors = ["Brian Martin <brian@pelikan.io>"]
Expand All @@ -11,6 +11,6 @@ repository = "https://github.com/pelikan-io/rustcommon"
[dependencies]
ahash = "0.8.0"
clocksource = { version = "0.8.0", path = "../clocksource" }
metriken = { version = "0.4.0" }
metriken = { version = "0.5.1", path = "../metriken" }
log = { version = "0.4.17", features = ["std"] }
mpmc = "0.1.6"

0 comments on commit 039544c

Please sign in to comment.