Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9722ec74 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove kPullerCooldownMap from code" into pi-dev

parents 82bc5bae e05c8e77
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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);
}

+0 −12
Original line number Diff line number Diff line
@@ -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);
+0 −7
Original line number Diff line number Diff line
@@ -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;