HdrHistogram_c icon indicating copy to clipboard operation
HdrHistogram_c copied to clipboard

hdr_min when nothing is recorded yet

Open pkbehera opened this issue 5 months ago • 0 comments

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?

pkbehera avatar Sep 27 '24 20:09 pkbehera