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()
93 const int64_t bucketNum) { in addPastBucket() argument
96 bucketNum < 0 || bucketNum <= mMostRecentBucketNum - mNumOfPastBuckets) { in addPastBucket()
100 const int bucketIndex = index(bucketNum); in addPastBucket()
101 if (bucketNum <= mMostRecentBucketNum && (mPastBuckets[bucketIndex] != nullptr)) { in addPastBucket()
117 addPastBucket(bucket, bucketNum); in addPastBucket()
122 const int64_t bucketNum) { in addPastBucket() argument
125 bucketNum < 0 || bucketNum <= mMostRecentBucketNum - mNumOfPastBuckets) { in addPastBucket()
129 if (bucketNum <= mMostRecentBucketNum) { in addPastBucket()
131 subtractBucketFromSum(mPastBuckets[index(bucketNum)]); in addPastBucket()
134 advanceMostRecentBucketTo(bucketNum); in addPastBucket()
136 mPastBuckets[index(bucketNum)] = bucket; in addPastBucket()
172 const int64_t bucketNum) const { in getPastBucketValue()
173 if (bucketNum < 0 || mMostRecentBucketNum < 0 in getPastBucketValue()
174 || bucketNum <= mMostRecentBucketNum - mNumOfPastBuckets in getPastBucketValue()
175 || bucketNum > mMostRecentBucketNum) { in getPastBucketValue()
179 const auto& bucket = mPastBuckets[index(bucketNum)]; in getPastBucketValue()