class IntegerBucketConfig

Defined at line 18 of file ../../third_party/cobalt/src/lib/client/cpp/buckets_config.h

IntegerBucketConfig implements the logic for converting an integer into a

bucket index according to Cobalt's IntegerBuckets scheme. See the comments in

metrics.proto for a description of that scheme.

Public Methods

std::unique_ptr<IntegerBucketConfig> CreateFromProto (const IntegerBuckets & int_buckets)

Constructs and returns an instance of IntegerBucketConfig based on the

provided IntegerBuckets proto message.

If it fails, it will log an error message and the returned pointer will be

null.

uint32_t BucketIndex (int64_t val)

Maps an integer value to a bucket index.

Recall that index 0 is the index of the underflow bucket and

OverflowBucket() is the index of the overflow bucket.

int64_t BucketFloor (uint32_t index)

Returns the floor of bucket |index|. Returns INT64_MIN if |index| is the index of the underflow

bucket, or if |index| is not a valid bucket index.

bool IsImpossibleBucket (uint32_t index)

Returns true if the bucket |index| is impossible to have values in, or if |index| is not a

valid bucket index.

With a step multiplier between 1 and 2, some of the buckets are for a

floating point range that doesn't include any round integer values.

uint32_t UnderflowBucket ()

Returns the index of the underflow bucket: 0.

Defined at line 32 of file ../../third_party/cobalt/src/lib/client/cpp/buckets_config.h

uint32_t OverflowBucket ()

Returns the index of the overflow bucket.

Defined at line 35 of file ../../third_party/cobalt/src/lib/client/cpp/buckets_config.h