Loading cmds/statsd/src/StatsLogProcessor.h +3 −0 Original line number Diff line number Diff line Loading @@ -235,9 +235,12 @@ private: FRIEND_TEST(GaugeMetricE2eTest, TestMultipleFieldsForPushedEvent); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvents); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvent_LateAlarm); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEventsWithActivation); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEventsNoCondition); FRIEND_TEST(GaugeMetricE2eTest, TestConditionChangeToTrueSamplePulledEvents); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_LateAlarm); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_WithActivation); FRIEND_TEST(DimensionInConditionE2eTest, TestCreateCountMetric_NoLink_OR_CombinationCondition); FRIEND_TEST(DimensionInConditionE2eTest, TestCreateCountMetric_Link_OR_CombinationCondition); Loading cmds/statsd/src/external/StatsPullerManager.h +3 −0 Original line number Diff line number Diff line Loading @@ -120,8 +120,11 @@ private: FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvents); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvent_LateAlarm); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEventsWithActivation); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEventsNoCondition); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_LateAlarm); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_WithActivation); }; } // namespace statsd Loading cmds/statsd/src/metrics/GaugeMetricProducer.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -141,9 +141,6 @@ GaugeMetricProducer::GaugeMetricProducer( // Adjust start for partial bucket mCurrentBucketStartTimeNs = startTimeNs; if (mIsPulled && mSamplingType == GaugeMetric::RANDOM_ONE_SAMPLE) { pullAndMatchEventsLocked(startTimeNs); } VLOG("Gauge metric %lld created. bucket size %lld start_time: %lld sliced %d", (long long)metric.id(), (long long)mBucketSizeNs, (long long)mTimeBaseNs, Loading Loading @@ -315,6 +312,12 @@ void GaugeMetricProducer::onDumpReportLocked(const int64_t dumpTimeNs, } } void GaugeMetricProducer::prepareFistBucketLocked() { if (mIsActive && mIsPulled && mSamplingType == GaugeMetric::RANDOM_ONE_SAMPLE) { pullAndMatchEventsLocked(mCurrentBucketStartTimeNs); } } void GaugeMetricProducer::pullAndMatchEventsLocked(const int64_t timestampNs) { bool triggerPuller = false; switch(mSamplingType) { Loading cmds/statsd/src/metrics/GaugeMetricProducer.h +2 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,8 @@ private: void flushCurrentBucketLocked(const int64_t& eventTimeNs, const int64_t& nextBucketStartTimeNs) override; void prepareFistBucketLocked() override; void pullAndMatchEventsLocked(const int64_t timestampNs); const int mWhatMatcherIndex; Loading cmds/statsd/src/metrics/MetricProducer.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,9 @@ namespace statsd { using std::map; void MetricProducer::onMatchedLogEventLocked(const size_t matcherIndex, const LogEvent& event) { if (!mIsActive) { return; } int64_t eventTimeNs = event.GetElapsedTimestampNs(); // this is old event, maybe statsd restarted? if (eventTimeNs < mTimeBaseNs) { Loading Loading
cmds/statsd/src/StatsLogProcessor.h +3 −0 Original line number Diff line number Diff line Loading @@ -235,9 +235,12 @@ private: FRIEND_TEST(GaugeMetricE2eTest, TestMultipleFieldsForPushedEvent); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvents); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvent_LateAlarm); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEventsWithActivation); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEventsNoCondition); FRIEND_TEST(GaugeMetricE2eTest, TestConditionChangeToTrueSamplePulledEvents); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_LateAlarm); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_WithActivation); FRIEND_TEST(DimensionInConditionE2eTest, TestCreateCountMetric_NoLink_OR_CombinationCondition); FRIEND_TEST(DimensionInConditionE2eTest, TestCreateCountMetric_Link_OR_CombinationCondition); Loading
cmds/statsd/src/external/StatsPullerManager.h +3 −0 Original line number Diff line number Diff line Loading @@ -120,8 +120,11 @@ private: FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvents); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvent_LateAlarm); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEventsWithActivation); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEventsNoCondition); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_LateAlarm); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_WithActivation); }; } // namespace statsd Loading
cmds/statsd/src/metrics/GaugeMetricProducer.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -141,9 +141,6 @@ GaugeMetricProducer::GaugeMetricProducer( // Adjust start for partial bucket mCurrentBucketStartTimeNs = startTimeNs; if (mIsPulled && mSamplingType == GaugeMetric::RANDOM_ONE_SAMPLE) { pullAndMatchEventsLocked(startTimeNs); } VLOG("Gauge metric %lld created. bucket size %lld start_time: %lld sliced %d", (long long)metric.id(), (long long)mBucketSizeNs, (long long)mTimeBaseNs, Loading Loading @@ -315,6 +312,12 @@ void GaugeMetricProducer::onDumpReportLocked(const int64_t dumpTimeNs, } } void GaugeMetricProducer::prepareFistBucketLocked() { if (mIsActive && mIsPulled && mSamplingType == GaugeMetric::RANDOM_ONE_SAMPLE) { pullAndMatchEventsLocked(mCurrentBucketStartTimeNs); } } void GaugeMetricProducer::pullAndMatchEventsLocked(const int64_t timestampNs) { bool triggerPuller = false; switch(mSamplingType) { Loading
cmds/statsd/src/metrics/GaugeMetricProducer.h +2 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,8 @@ private: void flushCurrentBucketLocked(const int64_t& eventTimeNs, const int64_t& nextBucketStartTimeNs) override; void prepareFistBucketLocked() override; void pullAndMatchEventsLocked(const int64_t timestampNs); const int mWhatMatcherIndex; Loading
cmds/statsd/src/metrics/MetricProducer.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,9 @@ namespace statsd { using std::map; void MetricProducer::onMatchedLogEventLocked(const size_t matcherIndex, const LogEvent& event) { if (!mIsActive) { return; } int64_t eventTimeNs = event.GetElapsedTimestampNs(); // this is old event, maybe statsd restarted? if (eventTimeNs < mTimeBaseNs) { Loading