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

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

Issue 137623002: Let MetricsService know about some Android Activities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: line warp fix Created 6 years, 10 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
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 : histogram_snapshot_manager_(this) { 14 : histogram_snapshot_manager_(this) {
15 } 15 }
16 16
17 MetricsServiceBase::~MetricsServiceBase() { 17 MetricsServiceBase::~MetricsServiceBase() {
18 } 18 }
19 19
20 // static 20 // static
21 const char MetricsServiceBase::kServerUrl[] = 21 const char MetricsServiceBase::kServerUrl[] =
22 "https://clients4.google.com/uma/v2"; 22 "https://clients4.google.com/uma/v2";
23 23
24 // static 24 // static
25 const char MetricsServiceBase::kMimeType[] = "application/vnd.chrome.uma"; 25 const char MetricsServiceBase::kMimeType[] = "application/vnd.chrome.uma";
26 26
27 void MetricsServiceBase::RecordCurrentHistograms() { 27 void MetricsServiceBase::RecordCurrentHistograms() {
28 DCHECK(log_manager_.current_log()); 28 DCHECK(log_manager_.current_log());
29 histogram_snapshot_manager_.PrepareDeltas(base::Histogram::kNoFlags, true); 29 histogram_snapshot_manager_.PrepareDeltas(
30 base::Histogram::kNoFlags, base::Histogram::kUmaTargetedHistogramFlag);
31 }
32
33 void MetricsServiceBase::RecordCurrentStabilityHistograms() {
34 DCHECK(log_manager_.current_log());
35 histogram_snapshot_manager_.PrepareDeltas(
36 base::Histogram::kNoFlags, base::Histogram::kUmaStabilityHistogramFlag);
30 } 37 }
31 38
32 void MetricsServiceBase::RecordDelta( 39 void MetricsServiceBase::RecordDelta(
33 const base::HistogramBase& histogram, 40 const base::HistogramBase& histogram,
34 const base::HistogramSamples& snapshot) { 41 const base::HistogramSamples& snapshot) {
35 log_manager_.current_log()->RecordHistogramDelta(histogram.histogram_name(), 42 log_manager_.current_log()->RecordHistogramDelta(histogram.histogram_name(),
36 snapshot); 43 snapshot);
37 } 44 }
38 45
39 void MetricsServiceBase::InconsistencyDetected( 46 void MetricsServiceBase::InconsistencyDetected(
40 base::HistogramBase::Inconsistency problem) { 47 base::HistogramBase::Inconsistency problem) {
41 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowser", 48 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowser",
42 problem, base::HistogramBase::NEVER_EXCEEDED_VALUE); 49 problem, base::HistogramBase::NEVER_EXCEEDED_VALUE);
43 } 50 }
44 51
45 void MetricsServiceBase::UniqueInconsistencyDetected( 52 void MetricsServiceBase::UniqueInconsistencyDetected(
46 base::HistogramBase::Inconsistency problem) { 53 base::HistogramBase::Inconsistency problem) {
47 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique", 54 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique",
48 problem, base::HistogramBase::NEVER_EXCEEDED_VALUE); 55 problem, base::HistogramBase::NEVER_EXCEEDED_VALUE);
49 } 56 }
50 57
51 void MetricsServiceBase::InconsistencyDetectedInLoggedCount(int amount) { 58 void MetricsServiceBase::InconsistencyDetectedInLoggedCount(int amount) {
52 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser", 59 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser",
53 std::abs(amount)); 60 std::abs(amount));
54 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698