Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite of the histogram crate #66

Merged
merged 53 commits into from
Sep 27, 2023
Merged

Conversation

brayniac
Copy link
Contributor

Rewrite the histogram crate to merge heatmap functionality into this crate and
reparameterize the histogram constructors.

Rewrite the histogram crate to merge heatmap functionality into
this crate and reparameterize the histogram constructors.
Adds a few benchmarks and increases the minimum interval for the
sliding window histograms. We can lower it in the future, but for
now, increasing to milliseonds as finest resolution prevents
excessive looping when snapshots are needed on increment.
Copy link
Member

@thinkingfish thinkingfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial review

histogram/Cargo.toml Outdated Show resolved Hide resolved
clocksource/src/precise/duration.rs Outdated Show resolved Hide resolved
histogram/src/lib.rs Outdated Show resolved Hide resolved
histogram/src/lib.rs Outdated Show resolved Hide resolved
histogram/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@mihirn mihirn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review

histogram/src/compact.rs Outdated Show resolved Hide resolved
histogram/benches/histogram.rs Outdated Show resolved Hide resolved
histogram/src/atomic.rs Outdated Show resolved Hide resolved
histogram/src/compact.rs Outdated Show resolved Hide resolved
histogram/src/config.rs Outdated Show resolved Hide resolved
histogram/src/lib.rs Outdated Show resolved Hide resolved
histogram/src/lib.rs Outdated Show resolved Hide resolved
histogram/src/compact.rs Outdated Show resolved Hide resolved
histogram/src/lib.rs Outdated Show resolved Hide resolved
histogram/benches/histogram.rs Show resolved Hide resolved
histogram/src/config.rs Outdated Show resolved Hide resolved
histogram/src/sliding_window.rs Outdated Show resolved Hide resolved
histogram/src/sliding_window.rs Outdated Show resolved Hide resolved
histogram/src/sliding_window.rs Outdated Show resolved Hide resolved
histogram/src/sliding_window.rs Outdated Show resolved Hide resolved
histogram/src/snapshot.rs Outdated Show resolved Hide resolved
histogram/src/builder.rs Outdated Show resolved Hide resolved
histogram/src/config.rs Fixed Show fixed Hide fixed
histogram/src/config.rs Fixed Show fixed Hide fixed
histogram/src/sliding_window.rs Fixed Show fixed Hide fixed
histogram/src/sliding_window.rs Fixed Show fixed Hide fixed
histogram/benches/histogram.rs Fixed Show fixed Hide fixed
histogram/benches/histogram.rs Fixed Show fixed Hide fixed
histogram/src/standard.rs Fixed Show fixed Hide fixed
histogram/src/standard.rs Fixed Show fixed Hide fixed
}

/// Produce a snapshot from this histogram.
pub fn snapshot(&self) -> Snapshot {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need another API where the snapshot is pre-allocated and provided by the caller so we can minimize allocation? Fine to add it in a different PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snapshot_into() would be nice. Will do a follow-on PR.

@brayniac brayniac merged commit b216f26 into pelikan-io:main Sep 27, 2023
12 checks passed
@brayniac brayniac deleted the histogram-sliding branch September 27, 2023 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants