OSDN Git Service

Don't just clear mPastBuckets when onDumpReport is called.
authorYao Chen <yaochen@google.com>
Sat, 18 Nov 2017 22:14:38 +0000 (14:14 -0800)
committerYao Chen <yaochen@google.com>
Sat, 18 Nov 2017 22:14:38 +0000 (14:14 -0800)
This needs to be done properly. Left a TODO.

Test: statsd_test
Change-Id: I8537f0a870ab82039e0822c69096784403ee1651

cmds/statsd/src/metrics/DurationMetricProducer.cpp

index 581ca41..8d2c9f4 100644 (file)
@@ -222,10 +222,8 @@ std::unique_ptr<std::vector<uint8_t>> DurationMetricProducer::onDumpReport() {
                   (long long)mCurrentBucketStartTimeNs);
 
     std::unique_ptr<std::vector<uint8_t>> buffer = serializeProto();
-
     startNewProtoOutputStream(endTime);
-    mPastBuckets.clear();
-
+    // TODO: Properly clear the old buckets.
     return buffer;
 }