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

Unified Diff: chrome/browser/policy/policy_load_status.cc

Issue 14294008: Add UMA histograms for policy loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/policy_load_status.h ('k') | chrome/browser/policy/policy_loader_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_load_status.cc
diff --git a/chrome/browser/policy/policy_load_status.cc b/chrome/browser/policy/policy_load_status.cc
new file mode 100644
index 0000000000000000000000000000000000000000..35a178fa043e6243a452235e1691f0b10dafa267
--- /dev/null
+++ b/chrome/browser/policy/policy_load_status.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/policy/policy_load_status.h"
+
+#include "base/metrics/histogram.h"
+#include "base/stringprintf.h"
+#include "chrome/browser/policy/policy_types.h"
+
+namespace policy {
+
+namespace {
+
+const char kHistogramName[] = "Enterprise.PolicyLoadStatus";
+
+} // namespace
+
+PolicyLoadStatusSample::PolicyLoadStatusSample()
+ : histogram_(base::LinearHistogram::FactoryGet(
+ kHistogramName, 1, POLICY_LOAD_STATUS_SIZE,
+ POLICY_LOAD_STATUS_SIZE + 1,
+ base::Histogram::kUmaTargetedHistogramFlag)) {
+ Add(POLICY_LOAD_STATUS_STARTED);
+}
+
+PolicyLoadStatusSample::~PolicyLoadStatusSample() {
+ for (int i = 0; i < POLICY_LOAD_STATUS_SIZE; ++i) {
+ if (status_bits_[i])
+ histogram_->Add(i);
+ }
+}
+
+void PolicyLoadStatusSample::Add(PolicyLoadStatus status) {
+ status_bits_[status] = true;
+}
+
+} // namespace policy
« no previous file with comments | « chrome/browser/policy/policy_load_status.h ('k') | chrome/browser/policy/policy_loader_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698