diff options
Diffstat (limited to 'cmds/statsd/src/metrics/EventMetricProducer.cpp')
-rw-r--r-- | cmds/statsd/src/metrics/EventMetricProducer.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cmds/statsd/src/metrics/EventMetricProducer.cpp b/cmds/statsd/src/metrics/EventMetricProducer.cpp index eec90fc8d053..a18e406b74ca 100644 --- a/cmds/statsd/src/metrics/EventMetricProducer.cpp +++ b/cmds/statsd/src/metrics/EventMetricProducer.cpp @@ -49,7 +49,6 @@ const int FIELD_ID_DATA = 1; // for EventMetricData const int FIELD_ID_ELAPSED_TIMESTAMP_NANOS = 1; const int FIELD_ID_ATOMS = 2; -const int FIELD_ID_WALL_CLOCK_TIMESTAMP_NANOS = 3; EventMetricProducer::EventMetricProducer(const ConfigKey& key, const EventMetric& metric, const int conditionIndex, @@ -106,6 +105,7 @@ void EventMetricProducer::clearPastBucketsLocked(const int64_t dumpTimeNs) { void EventMetricProducer::onDumpReportLocked(const int64_t dumpTimeNs, const bool include_current_partial_bucket, + const bool erase_data, std::set<string> *str_set, ProtoOutputStream* protoOutput) { if (mProto->size() <= 0) { @@ -121,7 +121,9 @@ void EventMetricProducer::onDumpReportLocked(const int64_t dumpTimeNs, protoOutput->write(FIELD_TYPE_MESSAGE | FIELD_ID_EVENT_METRICS, reinterpret_cast<char*>(buffer.get()->data()), buffer.get()->size()); - mProto->clear(); + if (erase_data) { + mProto->clear(); + } } void EventMetricProducer::onConditionChangedLocked(const bool conditionMet, @@ -146,13 +148,9 @@ void EventMetricProducer::onMatchedLogEventInternalLocked( if (truncateTimestamp) { mProto->write(FIELD_TYPE_INT64 | FIELD_ID_ELAPSED_TIMESTAMP_NANOS, (long long)truncateTimestampNsToFiveMinutes(event.GetElapsedTimestampNs())); - mProto->write(FIELD_TYPE_INT64 | FIELD_ID_WALL_CLOCK_TIMESTAMP_NANOS, - (long long)truncateTimestampNsToFiveMinutes(getWallClockNs())); } else { mProto->write(FIELD_TYPE_INT64 | FIELD_ID_ELAPSED_TIMESTAMP_NANOS, (long long)event.GetElapsedTimestampNs()); - mProto->write(FIELD_TYPE_INT64 | FIELD_ID_WALL_CLOCK_TIMESTAMP_NANOS, - (long long)getWallClockNs()); } uint64_t eventToken = mProto->start(FIELD_TYPE_MESSAGE | FIELD_ID_ATOMS); |