Remove data dropping as an invalid bucket case
ValueMetric's #dropData function flushes and clears the current bucket only if the drop time coincides with the end of the bucket. Otherwise, if the current bucket is a partial bucket, we keep this bucket for further aggregation so it should not be marked invalid. Test: bit statsd_test:* Bug: 145918755 Change-Id: I73bccf8fe9e223bd7927fffe2f1665744ae1b452
This commit is contained in:
@@ -183,11 +183,9 @@ void ValueMetricProducer::onSlicedConditionMayChangeLocked(bool overallCondition
|
||||
|
||||
void ValueMetricProducer::dropDataLocked(const int64_t dropTimeNs) {
|
||||
StatsdStats::getInstance().noteBucketDropped(mMetricId);
|
||||
// We are going to flush the data without doing a pull first so we need to invalidte the data.
|
||||
bool pullNeeded = mIsPulled && mCondition == ConditionState::kTrue;
|
||||
if (pullNeeded) {
|
||||
invalidateCurrentBucket();
|
||||
}
|
||||
|
||||
// The current partial bucket is not flushed and does not require a pull,
|
||||
// so the data is still valid.
|
||||
flushIfNeededLocked(dropTimeNs);
|
||||
clearPastBucketsLocked(dropTimeNs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user