Commit 1c9af66d authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

ksv: Measure how long it takes to update for search result.

Report how long it takes to update the views hierarchy in response
to a search-string. Also report how long it takes before the update
is visible on screen.

BUG=865295

Change-Id: I103aa5cbd86be3189ab44121e72d375e6d742b4b
Reviewed-on: https://chromium-review.googlesource.com/1188755Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586111}
parent 37e207eb
......@@ -414,6 +414,7 @@ void KeyboardShortcutView::UpdateViewsLayout(bool is_search_box_active) {
void KeyboardShortcutView::ShowSearchResults(
const base::string16& search_query) {
const base::TimeTicks start_time = base::TimeTicks::Now();
search_results_container_->RemoveAllChildViews(true);
auto* search_container_content_view = search_no_result_view_.get();
auto found_items_list_view = std::make_unique<KeyboardShortcutItemListView>();
......@@ -489,6 +490,21 @@ void KeyboardShortcutView::ShowSearchResults(
search_results_container_->AddChildView(search_container_content_view);
Layout();
SchedulePaint();
constexpr int kBucketCount = 100;
UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(
"Keyboard.ShortcutViewer.SearchUpdateTime",
base::TimeTicks::Now() - start_time,
base::TimeDelta::FromMicroseconds(50), base::TimeDelta::FromSeconds(1),
kBucketCount);
GetWidget()->GetCompositor()->RequestPresentationTimeForNextFrame(
base::BindOnce(
[](base::TimeTicks start_time,
const gfx::PresentationFeedback& feedback) {
UMA_HISTOGRAM_TIMES(
"Keyboard.ShortcutViewer.SearchUpdateTimeVisual",
feedback.timestamp - start_time);
},
start_time));
}
bool KeyboardShortcutView::CanMaximize() const {
......
......@@ -38525,6 +38525,28 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="Keyboard.ShortcutViewer.SearchUpdateTime" units="microseconds">
<owner>jamescook@chromium.org</owner>
<owner>msw@chromium.org</owner>
<owner>wutao@chromium.org</owner>
<summary>
Time delay to make the visual update in response to a search-query. Note
that this does *not* include the initial delay to trigger the update after
the initial keystroke to change the search-query string.
</summary>
</histogram>
<histogram name="Keyboard.ShortcutViewer.SearchUpdateTimeVisual" units="ms">
<owner>jamescook@chromium.org</owner>
<owner>msw@chromium.org</owner>
<owner>wutao@chromium.org</owner>
<summary>
Time delay for the visual update to be visible on screen in response to a
search-query. Note that this does *not* include the initial delay to trigger
the update after the initial keystroke to change the search-query string.
</summary>
</histogram>
<histogram name="Keyboard.ShortcutViewer.StartupTime" units="ms">
<owner>jamescook@chromium.org</owner>
<owner>msw@chromium.org</owner>
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