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

Histogram save load #4537

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Histogram save load #4537

wants to merge 1 commit into from

Conversation

IvanPleshkov
Copy link
Contributor

This PR is a part of on-disk-payload-feature.

For the on-disk numeric index, it was decided that the histogram would be still on RAM because it's pretty small. But we need persistence anyway to avoid a full scan while loading.

This PR adds save-load for histogram and use it in histogram unit test.

Comment on lines +254 to +262

// test persistence
let dir = tempfile::Builder::new()
.prefix("histogram_dir")
.tempdir()
.unwrap();
histogram.save(&dir).unwrap();
let histogram = Histogram::<f64>::load(&dir).unwrap();

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to not to mix things under the test. Instead, split into two parts:
In the first, run the old test without saving/loding.
In the second, do load/save and compare histograms using assert_eq!().

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.

None yet

2 participants