Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp

Issue 2871313002: Add histogram for Blink's spell check request interval (Closed)
Patch Set: Fri May 12 11:31:33 PDT 2017 Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
index e6f33b1706fda173d0eed478d76ae41fc286d48b..1c82ee9cdadb69e0f4579ec6b9489a04da39d7af 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
@@ -34,6 +34,7 @@
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "core/html/TextControlElement.h"
+#include "platform/Histogram.h"
#include "platform/text/TextCheckerClient.h"
namespace blink {
@@ -125,6 +126,7 @@ SpellCheckRequester::SpellCheckRequester(LocalFrame& frame)
: frame_(&frame),
last_request_sequence_(0),
last_processed_sequence_(0),
+ last_request_time_(0.0),
timer_to_process_queued_request_(
TaskRunnerHelper::Get(TaskType::kUnspecedTimer, &frame),
this,
@@ -154,6 +156,17 @@ void SpellCheckRequester::RequestCheckingFor(const EphemeralRange& range,
if (!request)
return;
+ DEFINE_STATIC_LOCAL(CustomCountHistogram,
+ spell_checker_request_interval_histogram,
+ ("WebCore.SpellChecker.RequestInterval", 0, 10000, 50));
+ const double current_request_time = MonotonicallyIncreasingTime();
+ if (request_num == 0 && last_request_time_ > 0) {
+ const double interval_ms =
+ (current_request_time - last_request_time_) * 1000.0;
+ spell_checker_request_interval_histogram.Count(interval_ms);
+ }
+ last_request_time_ = current_request_time;
+
DCHECK_EQ(request->Data().Sequence(), kUnrequestedTextCheckingSequence);
int sequence = ++last_request_sequence_;
if (sequence == kUnrequestedTextCheckingSequence)
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698