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

hdr_min when nothing is recorded yet #125

Open
pkbehera opened this issue Sep 27, 2024 · 0 comments
Open

hdr_min when nothing is recorded yet #125

pkbehera opened this issue Sep 27, 2024 · 0 comments

Comments

@pkbehera
Copy link

struct hdr_histogram* hdr_hist;
hdr_init(1,                               // Min value that can be recorded
         numeric_limits<int64_t>::max(),  // Max value, doesn't work with numeric_limits<uint64_t>::max()
         1,                               // Number of significant digits, must be between 1 & 5(inclusive)
         &hdr_hist);                      // Pointer to initialize

// Nothing recorded yet!
// EXPECT_EQ(hdr_min(hdr_hist), 0);   // fails: 9223372036854775807, bug?
EXPECT_EQ(hdr_max(hdr_hist), 0);      // success
// EXPECT_EQ(hdr_mean(hdr_hist), 0);  // -nan division by 0 (count)
EXPECT_EQ(hdr_hist->total_count, 0);  // success

Immediately after initializing a histogram, shouldn't the minimum value (hdr_min) be zero?

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

No branches or pull requests

1 participant