Skip to content

hdr_min when nothing is recorded yet #125

@pkbehera

Description

@pkbehera
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions