diff options
Diffstat (limited to 'cmds/statsd/src/StatsLogProcessor.h')
-rw-r--r-- | cmds/statsd/src/StatsLogProcessor.h | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/cmds/statsd/src/StatsLogProcessor.h b/cmds/statsd/src/StatsLogProcessor.h index 86eb855825aa..a5ce9b65f899 100644 --- a/cmds/statsd/src/StatsLogProcessor.h +++ b/cmds/statsd/src/StatsLogProcessor.h @@ -18,7 +18,6 @@ #include <gtest/gtest_prod.h> #include "config/ConfigListener.h" -#include "logd/LogReader.h" #include "metrics/MetricsManager.h" #include "packages/UidMap.h" #include "external/StatsPullerManager.h" @@ -46,15 +45,13 @@ enum DumpReportReason { class StatsLogProcessor : public ConfigListener { public: - StatsLogProcessor(const sp<UidMap>& uidMap, const sp<AlarmMonitor>& anomalyAlarmMonitor, + StatsLogProcessor(const sp<UidMap>& uidMap, const sp<StatsPullerManager>& pullerManager, + const sp<AlarmMonitor>& anomalyAlarmMonitor, const sp<AlarmMonitor>& subscriberTriggerAlarmMonitor, const int64_t timeBaseNs, const std::function<bool(const ConfigKey&)>& sendBroadcast); virtual ~StatsLogProcessor(); - void OnLogEvent(LogEvent* event, bool reconnectionStarts); - - // for testing only. void OnLogEvent(LogEvent* event); void OnConfigUpdated(const int64_t timestampNs, const ConfigKey& key, @@ -64,8 +61,11 @@ public: size_t GetMetricsSize(const ConfigKey& key) const; void onDumpReport(const ConfigKey& key, const int64_t dumpTimeNs, - const bool include_current_partial_bucket, + const bool include_current_partial_bucket, const bool erase_data, const DumpReportReason dumpReportReason, vector<uint8_t>* outData); + void onDumpReport(const ConfigKey& key, const int64_t dumpTimeNs, + const bool include_current_partial_bucket, const bool erase_data, + const DumpReportReason dumpReportReason, ProtoOutputStream* proto); /* Tells MetricsManager that the alarms in alarmSet have fired. Modifies anomaly alarmSet. */ void onAnomalyAlarmFired( @@ -87,7 +87,7 @@ public: return mUidMap; } - void dumpStates(FILE* out, bool verbose); + void dumpStates(int outFd, bool verbose); void informPullAlarmFired(const int64_t timestampNs); @@ -127,7 +127,7 @@ private: sp<UidMap> mUidMap; // Reference to the UidMap to lookup app name and version for each uid. - StatsPullerManager mStatsPullerManager; + sp<StatsPullerManager> mPullerManager; // Reference to StatsPullerManager sp<AlarmMonitor> mAnomalyAlarmMonitor; @@ -144,6 +144,7 @@ private: void onConfigMetricsReportLocked(const ConfigKey& key, const int64_t dumpTimeStampNs, const bool include_current_partial_bucket, + const bool erase_data, const DumpReportReason dumpReportReason, util::ProtoOutputStream* proto); @@ -174,14 +175,6 @@ private: int64_t mLastTimestampSeen = 0; - bool mInReconnection = false; - - // Processed log count - uint64_t mLogCount = 0; - - // Log loss detected count - int mLogLossCount = 0; - long mLastPullerCacheClearTimeSec = 0; // Last time we wrote data to disk. @@ -208,7 +201,7 @@ private: FRIEND_TEST(GaugeMetricE2eTest, TestMultipleFieldsForPushedEvent); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvents); FRIEND_TEST(GaugeMetricE2eTest, TestRandomSamplePulledEvent_LateAlarm); - FRIEND_TEST(GaugeMetricE2eTest, TestAllConditionChangesSamplePulledEvents); + FRIEND_TEST(GaugeMetricE2eTest, TestConditionChangeToTrueSamplePulledEvents); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents); FRIEND_TEST(ValueMetricE2eTest, TestPulledEvents_LateAlarm); @@ -233,6 +226,7 @@ private: FRIEND_TEST(AlarmE2eTest, TestMultipleAlarms); FRIEND_TEST(ConfigTtlE2eTest, TestCountMetric); + FRIEND_TEST(MetricActivationE2eTest, TestCountMetric); }; } // namespace statsd |