Commit e8dbd426 authored by Rob Schonberger's avatar Rob Schonberger Committed by Commit Bot

Add a timer histogram for PalmDetectionFilter Filter time, and test it.

This adds a timer histogram for all PalmDetectionFilter->Filter
executions. We'll keep the timer whenever we change the underlying
filter implementation.

Adds a unit test that ensures the timer is populated.

Bug: 982118
Change-Id: I410ca0348bca9c556f4dff05ab5e228a1f09516d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1824796Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Commit-Queue: Rob Schonberger <robsc@google.com>
Cr-Commit-Position: refs/heads/master@{#699983}
parent fde745d0
......@@ -553,7 +553,10 @@ void TouchEventConverterEvdev::ReportEvents(base::TimeTicks timestamp) {
if (false_touch_finder_)
false_touch_finder_->HandleTouches(events_, timestamp);
std::bitset<kNumTouchEvdevSlots> hold, suppress;
{
SCOPED_UMA_HISTOGRAM_TIMER(kPalmFilterTimerEventName);
palm_detection_filter_->Filter(events_, timestamp, &hold, &suppress);
}
for (size_t i = 0; i < events_.size(); i++) {
InProgressTouchEvdev* event = &events_[i];
if (IsPalm(*event)) {
......@@ -683,4 +686,6 @@ const char TouchEventConverterEvdev::kHoldCountAtReleaseEventName[] =
"Ozone.TouchEventConverterEvdev.HoldCountAtRelease";
const char TouchEventConverterEvdev::kHoldCountAtCancelEventName[] =
"Ozone.TouchEventConverterEvdev.HoldCountAtCancel";
const char TouchEventConverterEvdev::kPalmFilterTimerEventName[] =
"Ozone.TouchEventConverterEvdev.PalmDetectionFilterTime";
} // namespace ui
......@@ -70,6 +70,7 @@ class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
static const char kHoldCountAtReleaseEventName[];
static const char kHoldCountAtCancelEventName[];
static const char kPalmFilterTimerEventName[];
private:
friend class MockTouchEventConverterEvdev;
......
......@@ -1628,6 +1628,9 @@ TEST_F(TouchEventConverterEvdevTest, HeldEventNotSent) {
EXPECT_THAT(histogram_tester_.GetAllSamples(
TouchEventConverterEvdev::kHoldCountAtCancelEventName),
testing::ElementsAre());
EXPECT_THAT(histogram_tester_.GetAllSamples(
TouchEventConverterEvdev::kPalmFilterTimerEventName),
testing::SizeIs(1));
}
TEST_F(TouchEventConverterEvdevTest, HeldThenEnd) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment