diff options
| -rw-r--r-- | cmds/statsd/src/external/StatsPuller.cpp | 7 | ||||
| -rw-r--r-- | cmds/statsd/src/guardrail/StatsdStats.cpp | 12 | ||||
| -rw-r--r-- | cmds/statsd/src/guardrail/StatsdStats.h | 7 | 
3 files changed, 2 insertions, 24 deletions
diff --git a/cmds/statsd/src/external/StatsPuller.cpp b/cmds/statsd/src/external/StatsPuller.cpp index 9513cc521af7..3b0cd349168d 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 @@ void StatsPuller::SetUidMap(const sp<UidMap>& uidMap) { mUidMap = uidMap; }  // 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 d626d901cdd0..c6c4d135ad3f 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_BYTES_USED = 3;  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 c3f401324454..d05c91b8d188 100644 --- a/cmds/statsd/src/guardrail/StatsdStats.h +++ b/cmds/statsd/src/guardrail/StatsdStats.h @@ -111,13 +111,6 @@ public:      /* 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;  |