Merge "Remove kPullerCooldownMap from code" into pi-dev
diff --git a/cmds/statsd/src/external/StatsPuller.cpp b/cmds/statsd/src/external/StatsPuller.cpp
index 9513cc5..3b0cd34 100644
--- a/cmds/statsd/src/external/StatsPuller.cpp
+++ b/cmds/statsd/src/external/StatsPuller.cpp
@@ -21,6 +21,7 @@
 #include "guardrail/StatsdStats.h"
 #include "puller_util.h"
 #include "stats_log_util.h"
+#include "StatsPullerManagerImpl.h"
 
 namespace android {
 namespace os {
@@ -34,11 +35,7 @@
 // ValueMetric has a minimum bucket size of 10min so that we don't pull too frequently
 StatsPuller::StatsPuller(const int tagId)
     : mTagId(tagId) {
-    if (StatsdStats::kPullerCooldownMap.find(tagId) == StatsdStats::kPullerCooldownMap.end()) {
-        mCoolDownSec = StatsdStats::kDefaultPullerCooldown;
-    } else {
-        mCoolDownSec = StatsdStats::kPullerCooldownMap[tagId];
-    }
+    mCoolDownSec = StatsPullerManagerImpl::kAllPullAtomInfo.find(tagId)->second.coolDownSec;
     VLOG("Puller for tag %d created. Cooldown set to %ld", mTagId, mCoolDownSec);
 }
 
diff --git a/cmds/statsd/src/guardrail/StatsdStats.cpp b/cmds/statsd/src/guardrail/StatsdStats.cpp
index d626d90..c6c4d13 100644
--- a/cmds/statsd/src/guardrail/StatsdStats.cpp
+++ b/cmds/statsd/src/guardrail/StatsdStats.cpp
@@ -91,18 +91,6 @@
 const int FIELD_ID_UID_MAP_DROPPED_SNAPSHOTS = 4;
 const int FIELD_ID_UID_MAP_DROPPED_CHANGES = 5;
 
-std::map<int, long> StatsdStats::kPullerCooldownMap = {
-        {android::util::KERNEL_WAKELOCK, 1},
-        {android::util::WIFI_BYTES_TRANSFER, 1},
-        {android::util::MOBILE_BYTES_TRANSFER, 1},
-        {android::util::WIFI_BYTES_TRANSFER_BY_FG_BG, 1},
-        {android::util::MOBILE_BYTES_TRANSFER_BY_FG_BG, 1},
-        {android::util::SUBSYSTEM_SLEEP_STATE, 1},
-        {android::util::CPU_TIME_PER_FREQ, 1},
-        {android::util::CPU_TIME_PER_UID, 1},
-        {android::util::CPU_TIME_PER_UID_FREQ, 1},
-};
-
 // TODO: add stats for pulled atoms.
 StatsdStats::StatsdStats() {
     mPushedAtomStats.resize(android::util::kMaxPushedAtomId + 1);
diff --git a/cmds/statsd/src/guardrail/StatsdStats.h b/cmds/statsd/src/guardrail/StatsdStats.h
index c3f4013..d05c91b 100644
--- a/cmds/statsd/src/guardrail/StatsdStats.h
+++ b/cmds/statsd/src/guardrail/StatsdStats.h
@@ -111,13 +111,6 @@
     /* Min period between two checks of byte size per config key in nanoseconds. */
     static const unsigned long long kMinByteSizeCheckPeriodNs = 10 * NS_PER_SEC;
 
-    // Default minimum interval between pulls for an atom. Pullers can return cached values if
-    // another pull request happens within this interval.
-    static std::map<int, long> kPullerCooldownMap;
-
-    // Default cooldown time for a puller
-    static const long kDefaultPullerCooldown = 1;
-
     // Maximum age (30 days) that files on disk can exist in seconds.
     static const int kMaxAgeSecond = 60 * 60 * 24 * 30;