Lines Matching refs:bucketNum
59 size_t AnomalyTracker::index(int64_t bucketNum) const { in index()
60 if (bucketNum < 0) { in index()
61 ALOGE("index() was passed a negative bucket number (%lld)!", (long long)bucketNum); in index()
63 return bucketNum % mNumOfPastBuckets; in index()
66 void AnomalyTracker::advanceMostRecentBucketTo(const int64_t& bucketNum) { in advanceMostRecentBucketTo() argument
71 if (bucketNum <= mMostRecentBucketNum) { in advanceMostRecentBucketTo()
73 (long long)bucketNum, (long long)mMostRecentBucketNum); in advanceMostRecentBucketTo()
77 if (bucketNum >= mMostRecentBucketNum + mNumOfPastBuckets) { in advanceMostRecentBucketTo()
79 mMostRecentBucketNum = bucketNum; in advanceMostRecentBucketTo()
84 for (int64_t i = mMostRecentBucketNum + 1; i <= bucketNum; i++) { in advanceMostRecentBucketTo()
89 mMostRecentBucketNum = bucketNum; in advanceMostRecentBucketTo()
94 const int64_t& bucketNum) { in addPastBucket() argument
97 bucketNum < 0 || bucketNum <= mMostRecentBucketNum - mNumOfPastBuckets) { in addPastBucket()
101 const int bucketIndex = index(bucketNum); in addPastBucket()
102 if (bucketNum <= mMostRecentBucketNum && (mPastBuckets[bucketIndex] != nullptr)) { in addPastBucket()
118 addPastBucket(bucket, bucketNum); in addPastBucket()
123 const int64_t& bucketNum) { in addPastBucket() argument
126 bucketNum < 0 || bucketNum <= mMostRecentBucketNum - mNumOfPastBuckets) { in addPastBucket()
130 if (bucketNum <= mMostRecentBucketNum) { in addPastBucket()
132 subtractBucketFromSum(mPastBuckets[index(bucketNum)]); in addPastBucket()
135 advanceMostRecentBucketTo(bucketNum); in addPastBucket()
137 mPastBuckets[index(bucketNum)] = bucket; in addPastBucket()
174 const int64_t& bucketNum) const { in getPastBucketValue()
175 if (bucketNum < 0 || mMostRecentBucketNum < 0 in getPastBucketValue()
176 || bucketNum <= mMostRecentBucketNum - mNumOfPastBuckets in getPastBucketValue()
177 || bucketNum > mMostRecentBucketNum) { in getPastBucketValue()
181 const auto& bucket = mPastBuckets[index(bucketNum)]; in getPastBucketValue()