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

Side by Side Diff: chrome/common/metrics/metrics_service_base.cc

Issue 10454086: Histograms - Support histograms for Plugins, GPU (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/metrics/metrics_service_base.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/metrics/metrics_service_base.h" 5 #include "chrome/common/metrics/metrics_service_base.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 8
9 #include "chrome/common/metrics/metrics_log_base.h" 9 #include "chrome/common/metrics/metrics_log_base.h"
10 10
11 using base::Histogram; 11 using base::Histogram;
12 12
13 MetricsServiceBase::MetricsServiceBase() { 13 MetricsServiceBase::MetricsServiceBase()
14 : ALLOW_THIS_IN_INITIALIZER_LIST(histogram_snapshot_manager_(this)) {
14 } 15 }
15 16
16 MetricsServiceBase::~MetricsServiceBase() { 17 MetricsServiceBase::~MetricsServiceBase() {
17 } 18 }
18 19
19 // static 20 // static
20 const char MetricsServiceBase::kServerUrlXml[] = 21 const char MetricsServiceBase::kServerUrlXml[] =
21 "https://clients4.google.com/firefox/metrics/collect"; 22 "https://clients4.google.com/firefox/metrics/collect";
22 const char MetricsServiceBase::kServerUrlProto[] = 23 const char MetricsServiceBase::kServerUrlProto[] =
23 "https://clients4.google.com/uma/v2"; 24 "https://clients4.google.com/uma/v2";
24 25
25 // static 26 // static
26 const char MetricsServiceBase::kMimeTypeXml[] = 27 const char MetricsServiceBase::kMimeTypeXml[] =
27 "application/vnd.mozilla.metrics.bz2"; 28 "application/vnd.mozilla.metrics.bz2";
28 // static 29 // static
29 const char MetricsServiceBase::kMimeTypeProto[] = 30 const char MetricsServiceBase::kMimeTypeProto[] =
30 "application/vnd.chrome.uma"; 31 "application/vnd.chrome.uma";
31 32
32 void MetricsServiceBase::RecordCurrentHistograms() { 33 void MetricsServiceBase::RecordCurrentHistograms() {
33 DCHECK(log_manager_.current_log()); 34 DCHECK(log_manager_.current_log());
34 TransmitAllHistograms(base::Histogram::kNoFlags, true); 35 histogram_snapshot_manager_.PrepareDeltas(base::Histogram::kNoFlags, true);
35 } 36 }
36 37
37 void MetricsServiceBase::TransmitHistogramDelta( 38 void MetricsServiceBase::RecordDelta(
38 const base::Histogram& histogram, 39 const base::Histogram& histogram,
39 const base::Histogram::SampleSet& snapshot) { 40 const base::Histogram::SampleSet& snapshot) {
40 log_manager_.current_log()->RecordHistogramDelta(histogram, snapshot); 41 log_manager_.current_log()->RecordHistogramDelta(histogram, snapshot);
41 } 42 }
42 43
43 void MetricsServiceBase::InconsistencyDetected(int problem) { 44 void MetricsServiceBase::InconsistencyDetected(int problem) {
44 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowser", 45 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowser",
45 problem, Histogram::NEVER_EXCEEDED_VALUE); 46 problem, Histogram::NEVER_EXCEEDED_VALUE);
46 } 47 }
47 48
48 void MetricsServiceBase::UniqueInconsistencyDetected(int problem) { 49 void MetricsServiceBase::UniqueInconsistencyDetected(int problem) {
49 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique", 50 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique",
50 problem, Histogram::NEVER_EXCEEDED_VALUE); 51 problem, Histogram::NEVER_EXCEEDED_VALUE);
51 } 52 }
52 53
53 void MetricsServiceBase::SnapshotProblemResolved(int amount) { 54 void MetricsServiceBase::SnapshotProblemResolved(int amount) {
54 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser", 55 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser",
55 std::abs(amount)); 56 std::abs(amount));
56 } 57 }
OLDNEW
« no previous file with comments | « chrome/common/metrics/metrics_service_base.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698