diff options
author | Yangster-mac <yanglu@google.com> | 2017-12-22 17:19:39 -0800 |
---|---|---|
committer | Yangster-mac <yanglu@google.com> | 2018-01-01 10:01:36 -0800 |
commit | 2087716f2bdca90c7c3034d556ac12911bd8018e (patch) | |
tree | 448895d8ce6f40644aa184b15fe024385d26d3c1 /cmds/statsd/src/matchers/SimpleLogMatchingTracker.cpp | |
parent | 28bc987f61400b2862174149486e9f032c386a5f (diff) |
1/ Support nested message and repeated fields in statsd.
2/ Filter gauge fields by FieldMatcher.
3/ Wire up wakelock attribution chain.
4/ e2e test: wakelock duration metric with aggregated predicate dimensions.
5/ e2e test: count metric with multiple metric condition links for 2 predicates and 1 non-sliced predicate.
Test: statsd unit test passed.
Change-Id: I89db31cb068184a54e0a892fad710966d3127bc9
Diffstat (limited to 'cmds/statsd/src/matchers/SimpleLogMatchingTracker.cpp')
-rw-r--r-- | cmds/statsd/src/matchers/SimpleLogMatchingTracker.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cmds/statsd/src/matchers/SimpleLogMatchingTracker.cpp b/cmds/statsd/src/matchers/SimpleLogMatchingTracker.cpp index ac217abecba3..91ef0344da91 100644 --- a/cmds/statsd/src/matchers/SimpleLogMatchingTracker.cpp +++ b/cmds/statsd/src/matchers/SimpleLogMatchingTracker.cpp @@ -30,12 +30,13 @@ using std::vector; SimpleLogMatchingTracker::SimpleLogMatchingTracker(const string& name, const int index, - const SimpleAtomMatcher& matcher) - : LogMatchingTracker(name, index), mMatcher(matcher) { - if (!matcher.has_tag()) { + const SimpleAtomMatcher& matcher, + const UidMap& uidMap) + : LogMatchingTracker(name, index), mMatcher(matcher), mUidMap(uidMap) { + if (!matcher.has_atom_id()) { mInitialized = false; } else { - mTagIds.insert(matcher.tag()); + mAtomIds.insert(matcher.atom_id()); mInitialized = true; } } @@ -59,12 +60,12 @@ void SimpleLogMatchingTracker::onLogEvent(const LogEvent& event, return; } - if (mTagIds.find(event.GetTagId()) == mTagIds.end()) { + if (mAtomIds.find(event.GetTagId()) == mAtomIds.end()) { matcherResults[mIndex] = MatchingState::kNotMatched; return; } - bool matched = matchesSimple(mMatcher, event); + bool matched = matchesSimple(mUidMap, mMatcher, event); matcherResults[mIndex] = matched ? MatchingState::kMatched : MatchingState::kNotMatched; VLOG("Stats SimpleLogMatcher %s matched? %d", mName.c_str(), matched); } |