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

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

Merge "StatsdStats alerts -rename alerted_times"

parents 4b1557d3 e1d143a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ void StatsdStats::addSubStatsToConfigLocked(const ConfigKey& key,
        for (const auto& stats : alertStats) {
            auto output = configStats.add_alert_stats();
            output->set_name(stats.first);
            output->set_declared_times(stats.second);
            output->set_alerted_times(stats.second);
            VLOG("alert %s declared %d times", stats.first.c_str(), stats.second);
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ message StatsdStatsReport {

    message AlertStats {
        optional string name = 1;
        optional int32 declared_times = 2;
        optional int32 alerted_times = 2;
    }

    message ConfigStats {
+3 −3
Original line number Diff line number Diff line
@@ -163,9 +163,9 @@ TEST(StatsdStatsTest, TestSubStats) {
    EXPECT_EQ(2, configReport.alert_stats_size());
    bool alert1first = !configReport.alert_stats(0).name().compare("alert1");
    EXPECT_EQ("alert1", configReport.alert_stats(alert1first ? 0 : 1).name());
    EXPECT_EQ(2, configReport.alert_stats(alert1first ? 0 : 1).declared_times());
    EXPECT_EQ(2, configReport.alert_stats(alert1first ? 0 : 1).alerted_times());
    EXPECT_EQ("alert2", configReport.alert_stats(alert1first ? 1 : 0).name());
    EXPECT_EQ(1, configReport.alert_stats(alert1first ? 1 : 0).declared_times());
    EXPECT_EQ(1, configReport.alert_stats(alert1first ? 1 : 0).alerted_times());

    EXPECT_EQ(1, configReport.condition_stats_size());
    EXPECT_EQ("condition1", configReport.condition_stats(0).name());
@@ -201,7 +201,7 @@ TEST(StatsdStatsTest, TestSubStats) {

    EXPECT_EQ(1, configReport2.alert_stats_size());
    EXPECT_EQ("alert99", configReport2.alert_stats(0).name());
    EXPECT_EQ(1, configReport2.alert_stats(0).declared_times());
    EXPECT_EQ(1, configReport2.alert_stats(0).alerted_times());
}

TEST(StatsdStatsTest, TestAtomLog) {