Commit 7178b8d0 authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

Bookmarks.FileSize histogram should be reported in kilobytes

This CL fixes a bug in reporting the Bookmarks.FileSize metric.
base::GetFileSize() return the file size in bytes while KBs are
required.

Additionally, UMA_HISTOGRAM_MEMORY_KB uses bucketing scheme as follows:
The first bucket is for files smaller than 1000K(1MB)
and the max bucket is for files larger than 500000KB (500MB)
This CL changes the bucketing scheme to better represent
small files (smaller than 1000KB)
And adjusts the max to be 50MB which is more suitable for bookmarks
files. 25 buckets should be enough for analysis.

It should be OK to change the bucketing scheme because it didn't hit
stable yet. Only canary reporting will be half broken.

Bug: 808439
Change-Id: I098f5df128949a9e545dc59973def693ec540ec1
Reviewed-on: https://chromium-review.googlesource.com/931507
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539536}
parent a11f4307
......@@ -83,8 +83,14 @@ void LoadCallback(const base::FilePath& path,
UMA_HISTOGRAM_TIMES("Bookmarks.DecodeTime",
TimeTicks::Now() - start_time);
int64_t size = 0;
if (base::GetFileSize(path, &size))
UMA_HISTOGRAM_MEMORY_KB("Bookmarks.FileSize", size);
if (base::GetFileSize(path, &size)) {
int64_t size_kb = size / 1024;
// For 0 bookmarks, file size is 700 bytes (less than 1KB)
// Bookmarks file size is not expected to exceed 50000KB (50MB) for most
// of the users.
UMA_HISTOGRAM_CUSTOM_COUNTS("Bookmarks.FileSize", size_kb, 1, 50000,
25);
}
load_index = true;
}
......
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