pull resource power manager stats into statsd
Test: tested on device and check output
Change-Id: I65932a5527d6099e12546b6928a24f3616e54e16
diff --git a/cmds/statsd/src/StatsService.cpp b/cmds/statsd/src/StatsService.cpp
index edb1a0f..11c5de1 100644
--- a/cmds/statsd/src/StatsService.cpp
+++ b/cmds/statsd/src/StatsService.cpp
@@ -373,12 +373,15 @@
status_t StatsService::cmd_print_pulled_metrics(FILE* out, const Vector<String8>& args) {
int s = atoi(args[1].c_str());
- auto stats = m_stats_puller_manager.Pull(s, time(nullptr));
- for (const auto& it : stats) {
- fprintf(out, "Pull from %d: %s\n", s, it->ToString().c_str());
+ vector<shared_ptr<LogEvent> > stats;
+ if (mStatsPullerManager.Pull(s, &stats)) {
+ for (const auto& it : stats) {
+ fprintf(out, "Pull from %d: %s\n", s, it->ToString().c_str());
+ }
+ fprintf(out, "Pull from %d: Received %zu elements\n", s, stats.size());
+ return NO_ERROR;
}
- fprintf(out, "Pull from %d: Received %zu elements\n", s, stats.size());
- return NO_ERROR;
+ return UNKNOWN_ERROR;
}
Status StatsService::informAllUidData(const vector<int32_t>& uid, const vector<int32_t>& version,
@@ -440,7 +443,7 @@
"Only system uid can call informPollAlarmFired");
}
- m_stats_puller_manager.OnAlarmFired();
+ mStatsPullerManager.OnAlarmFired();
if (DEBUG) ALOGD("StatsService::informPollAlarmFired succeeded");