From ca782ac5ff24f52e43543da51330948c294fbb48 Mon Sep 17 00:00:00 2001 From: Tej Singh Date: Fri, 1 Nov 2019 10:45:22 -0700 Subject: [PATCH] Store elapsedRealtimeNs as int64 instead of long long can be 32 bits, which will overflow in ~2 seconds if signed. Test: builds Change-Id: I78e69e2c2ceb21a5748d9d5d860b45e5a3fae865 Merged-In: I78e69e2c2ceb21a5748d9d5d860b45e5a3fae865 --- cmds/statsd/src/StatsLogProcessor.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmds/statsd/src/StatsLogProcessor.h b/cmds/statsd/src/StatsLogProcessor.h index f0db1b0128a11..313e16d19b62f 100644 --- a/cmds/statsd/src/StatsLogProcessor.h +++ b/cmds/statsd/src/StatsLogProcessor.h @@ -128,13 +128,13 @@ private: std::unordered_map> mMetricsManagers; - std::unordered_map mLastBroadcastTimes; + std::unordered_map mLastBroadcastTimes; // Last time we sent a broadcast to this uid that the active configs had changed. - std::unordered_map mLastActivationBroadcastTimes; + std::unordered_map mLastActivationBroadcastTimes; // Tracks when we last checked the bytes consumed for each config key. - std::unordered_map mLastByteSizeTimes; + std::unordered_map mLastByteSizeTimes; // Tracks which config keys has metric reports on disk std::set mOnDiskDataConfigs; @@ -205,7 +205,7 @@ private: int64_t mLastTimestampSeen = 0; - long mLastPullerCacheClearTimeSec = 0; + int64_t mLastPullerCacheClearTimeSec = 0; // Last time we wrote data to disk. int64_t mLastWriteTimeNs = 0;