Statsd can pull kernel wakelock data
When statsd is told that it is time to poll data, it asks
StatsCompanionService to pull kernel wakelock data, receives the result
(as a string), and outputs it to screen.
Still to do:
1. don't use a string; use a parcel instead
2. don't output it to screen; do something useful instead
3. do more than just kernel wakelocks
4. pull data on demand, in addition to just on periodic pulling
Test: added setPollingAlarms to statsd.main and confirmed that kernel
wakelock information was written to screen
Change-Id: I35f5164420699dea1a00c9e530b938904f1d3055
diff --git a/cmds/statsd/src/StatsService.h b/cmds/statsd/src/StatsService.h
index a956cbf..b02579d 100644
--- a/cmds/statsd/src/StatsService.h
+++ b/cmds/statsd/src/StatsService.h
@@ -19,6 +19,7 @@
#include "AnomalyMonitor.h"
#include "StatsLogProcessor.h"
+#include "StatsPuller.h"
#include <android/os/BnStatsManager.h>
#include <android/os/IStatsCompanionService.h>
@@ -67,19 +68,21 @@
/** Inform statsCompanion that statsd is ready. */
virtual void sayHiToStatsCompanion();
-private:
- sp<StatsLogProcessor> m_processor; // Reference to the processor for updating configs.
+ // TODO: Move this to a more logical file/class
+ // TODO: Should be private. Temporarily public for testing purposes only.
+ const sp<AnomalyMonitor> mAnomalyMonitor;
- const sp<AnomalyMonitor> mAnomalyMonitor; // TODO: Move this to a more logical file/class
+ /** Fetches and returns the StatsCompanionService. */
+ static sp<IStatsCompanionService> getStatsCompanionService();
+
+ private:
+ sp<StatsLogProcessor> m_processor; // Reference to the processor for updating configs.
status_t doPrintStatsLog(FILE* out, const Vector<String8>& args);
void printCmdHelp(FILE* out);
status_t doLoadConfig(FILE* in);
-
- /** Fetches the StatsCompanionService. */
- sp<IStatsCompanionService> getStatsCompanionService();
};
// --- StatsdDeathRecipient ---