check in idx

This commit is contained in:
Fuheng Zhao 2021-06-28 14:16:41 -07:00
parent 7334ff8255
commit 8ba2991263
2 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,7 @@ typedef uint32_t QueueID;
// Pager Events
enum class events{ pagerCacheLookup = 0, pagerCacheHit, pagerCacheMiss, pagerWrite, MAXEVENTS};
// Reasons for page levle events.
enum class pagerEventReasons{ pointRead, rangeRead, rangePrefetch, commit, lazyClear, metaData, MAXEVENTREASONS};
enum class pagerEventReasons{ pointRead = 0, rangeRead, rangePrefetch, commit, lazyClear, metaData, MAXEVENTREASONS};
// Represents a block of memory in a 4096-byte aligned location held by an Arena.
class ArenaPage : public ReferenceCounted<ArenaPage>, public FastAllocated<ArenaPage> {

View File

@ -145,6 +145,7 @@ public:
ASSERT(unit==Histogram::Unit::record_counter);
size_t idx = ( (sample - lowerBound) * 31.0 ) / (upperBound - lowerBound);
if(idx >= 32){ idx = 31;}
ASSERT(idx < 32);
buckets[idx]++;