summaryrefslogtreecommitdiff
path: root/statsd/src/metrics/MetricsManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'statsd/src/metrics/MetricsManager.h')
-rw-r--r--statsd/src/metrics/MetricsManager.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/statsd/src/metrics/MetricsManager.h b/statsd/src/metrics/MetricsManager.h
index 3b28b6a3..22d5ecf1 100644
--- a/statsd/src/metrics/MetricsManager.h
+++ b/statsd/src/metrics/MetricsManager.h
@@ -57,8 +57,6 @@ public:
// Return whether the configuration is valid.
bool isConfigValid() const;
- bool checkLogCredentials(const LogEvent& event);
-
virtual void onLogEvent(const LogEvent& event);
void onAnomalyAlarmFired(
@@ -325,6 +323,12 @@ private:
std::vector<int> mMetricIndexesWithActivation;
+ inline bool checkLogCredentials(const LogEvent& event) const {
+ return checkLogCredentials(event.GetUid(), event.GetTagId());
+ }
+
+ bool checkLogCredentials(int32_t uid, int32_t atomId) const;
+
void initAllowedLogSources();
void initPullAtomSources();
@@ -365,6 +369,8 @@ private:
// metrics.
void setTriggerGetDataBytesFromConfig(const StatsdConfig& config);
+ void onLogEventLost(const SocketLossInfo& socketLossInfo);
+
// The memory limit in bytes for storing metrics
size_t mMaxMetricsBytes;
@@ -406,7 +412,10 @@ private:
FRIEND_TEST(MetricActivationE2eTest, TestCountMetricWithTwoMetricsTwoDeactivations);
FRIEND_TEST(MetricsManagerTest, TestLogSources);
+ FRIEND_TEST(MetricsManagerTest, TestCheckLogCredentialsWhitelistedAtom);
FRIEND_TEST(MetricsManagerTest, TestLogSourcesOnConfigUpdate);
+ FRIEND_TEST(MetricsManagerTest, TestOnLogEventLossForAllowedFromAnyUidAtom);
+ FRIEND_TEST(MetricsManagerTest, TestOnLogEventLossForNotAllowedAtom);
FRIEND_TEST(MetricsManagerTest_SPlus, TestRestrictedMetricsConfig);
FRIEND_TEST(MetricsManagerTest_SPlus, TestRestrictedMetricsConfigUpdate);
FRIEND_TEST(MetricsManagerUtilTest, TestSampledMetrics);