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

Commit 87718e28 authored by Yangster-mac's avatar Yangster-mac
Browse files

Gauge metric e2e test

Test: new test passed
Change-Id: I6a8bceb43fbb6e7b82f47951e71b5620779f2ceb
parent 278050ed
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -186,7 +186,8 @@ LOCAL_SRC_FILES := \
    tests/statsd_test_util.cpp \
    tests/e2e/WakelockDuration_e2e_test.cpp \
    tests/e2e/MetricConditionLink_e2e_test.cpp \
    tests/e2e/Attribution_e2e_test.cpp
    tests/e2e/Attribution_e2e_test.cpp \
    tests/e2e/GaugeMetric_e2e_test.cpp

LOCAL_STATIC_LIBRARIES := \
    $(statsd_common_static_libraries) \
+1 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ private:
    FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensions);
    FRIEND_TEST(MetricConditionLinkE2eTest, TestMultiplePredicatesAndLinks);
    FRIEND_TEST(AttributionE2eTest, TestAttributionMatchAndSlice);
    FRIEND_TEST(GaugeMetricE2eTest, TestMultipleFieldsForPushedEvent);

};

+4 −0
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@ namespace statsd {
const DimensionsValue* getSingleLeafValue(const DimensionsValue* value);
DimensionsValue getSingleLeafValue(const DimensionsValue& value);

// Appends the leaf node to the parent tree.
void appendLeafNodeToParent(const Field& field, const DimensionsValue& value,
                            DimensionsValue* parentValue);

// Constructs the DimensionsValue protos from the FieldMatcher. Each DimensionsValue proto
// represents a tree. When the input proto has repeated fields and the input "dimensions" wants
// "ANY" locations, it will return multiple trees.
+3 −0
Original line number Diff line number Diff line
@@ -114,6 +114,9 @@ GaugeMetricProducer::~GaugeMetricProducer() {

void GaugeMetricProducer::onDumpReportLocked(const uint64_t dumpTimeNs, StatsLogReport* report) {
    flushIfNeededLocked(dumpTimeNs);
    ProtoOutputStream pbOutput;
    onDumpReportLocked(dumpTimeNs, &pbOutput);
    parseProtoOutputStream(pbOutput, report);
}

void GaugeMetricProducer::onDumpReportLocked(const uint64_t dumpTimeNs,
+1 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ private:
    FRIEND_TEST(WakelockDurationE2eTest, TestAggregatedPredicateDimensions);
    FRIEND_TEST(MetricConditionLinkE2eTest, TestMultiplePredicatesAndLinks);
    FRIEND_TEST(AttributionE2eTest, TestAttributionMatchAndSlice);
    FRIEND_TEST(GaugeMetricE2eTest, TestMultipleFieldsForPushedEvent);
};

}  // namespace statsd
Loading