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

Side by Side Diff: storage/common/storage_histograms.cc

Issue 2858133002: Add uma stats to help evaluate the impact of changes to the quota allocation logic. (Closed)
Patch Set: xml 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 unified diff | Download patch
« no previous file with comments | « storage/common/storage_histograms.h ('k') | third_party/leveldatabase/env_chromium.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "storage/common/storage_histograms.h"
6
7 #include "base/metrics/histogram_macros.h"
8
9 namespace storage {
10
11 namespace {
12
13 base::HistogramBase* GetBytesCountHistogram(const std::string& name) {
14 const int kMin = 1;
15 const int kMax = 10000000;
jsbell 2017/05/04 19:43:37 Hrm, actually... does this mean the histogram maxe
jsbell 2017/05/04 19:48:00 Never mind, it's per-operation. That should be ple
16 const int kNumBuckets = 50;
17 return base::Histogram::FactoryGet(
18 name, kMin, kMax, kNumBuckets,
19 base::Histogram::kUmaTargetedHistogramFlag);
20 }
21
22 } // anonomous namespace
23
24 void RecordBytesWritten(const char* label, int amount) {
25 std::string name("Storage.BytesWritten.");
26 name.append(label);
27 GetBytesCountHistogram(name)->Add(amount);
28 }
29
30 void RecordBytesRead(const char* label, int amount) {
31 std::string name("Storage.BytesRead.");
32 name.append(label);
33 GetBytesCountHistogram(name)->Add(amount);
34 }
35
36 } // namespace storage
OLDNEW
« no previous file with comments | « storage/common/storage_histograms.h ('k') | third_party/leveldatabase/env_chromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698