Commit da78af24 authored by kojii's avatar kojii Committed by Commit bot

Add UMA to measure time to open hyphenation dictionary

This patch adds UMA to measure time to open hyphenation dictionary.

The previous CL[1] added UMA that includes IPC as "Hyphenation.Open",
but this metric measures the time of the file task without the IPC.

[1] 2113933003

BUG=605840

Review-Url: https://codereview.chromium.org/2340613002
Cr-Commit-Position: refs/heads/master@{#418826}
parent 12092c50
......@@ -10,8 +10,10 @@
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/timer/elapsed_timer.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/cpp/system/platform_handle.h"
......@@ -43,7 +45,9 @@ static base::File& GetDictionaryFile(const std::string& locale) {
#endif
std::string filename = base::StringPrintf("hyph-%s.hyb", locale.c_str());
base::FilePath path = dir.AppendASCII(filename);
base::ElapsedTimer timer;
file.Initialize(path, base::File::FLAG_OPEN | base::File::FLAG_READ);
UMA_HISTOGRAM_TIMES("Hyphenation.Open.File", timer.Elapsed());
return file;
}
......
......@@ -19384,6 +19384,11 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<summary>The time it takes to open a hyphenation dictionary.</summary>
</histogram>
<histogram name="Hyphenation.Open.File" units="ms">
<owner>kojii@chromium.org</owner>
<summary>The time it takes to open a hyphenation dictionary file.</summary>
</histogram>
<histogram name="Import.ImportedHistorySize.AutoImportFromIE" units="urls">
<owner>gcomanici@chromium.org</owner>
<summary>
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