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

Unified Diff: chrome/browser/policy/enterprise_metrics.h

Issue 7105018: UMA metrics for cloud policies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments, rebased Created 9 years, 6 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
Index: chrome/browser/policy/enterprise_metrics.h
diff --git a/chrome/browser/policy/enterprise_metrics.h b/chrome/browser/policy/enterprise_metrics.h
new file mode 100644
index 0000000000000000000000000000000000000000..599b1dc7c7da84bd6377d47d7102c86bb94d8fb6
--- /dev/null
+++ b/chrome/browser/policy/enterprise_metrics.h
@@ -0,0 +1,133 @@
+// Copyright (c) 2011 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.
+
+#ifndef CHROME_BROWSER_POLICY_ENTERPRISE_METRICS_H_
+#define CHROME_BROWSER_POLICY_ENTERPRISE_METRICS_H_
+#pragma once
+
+namespace policy {
+
+// Metrics collected for enterprise events.
+
+// Events related to fetching, saving and loading DM server tokens.
+// These metrics are collected both for device and user tokens.
+enum MetricToken {
+ // An attempt was made to load a locally cached token.
+ kMetricTokenLoadRequested = 0,
kmixter1 2011/06/30 23:28:59 Do you want to instead have loadsuccess? Otherwis
Joao da Silva 2011/07/07 15:30:13 Agree. The last CL is now logging successful loads
+ // Reading a cached token from disk failed.
+ kMetricTokenLoadFailed,
+
+ // A token fetch request was sent to the DM server.
+ kMetricTokenFetchRequested,
+ // The request was invalid, or the HTTP request failed.
+ kMetricTokenFetchRequestFailed,
+ // Error HTTP status received, or the DM server failed in another way.
+ kMetricTokenFetchServerFailed,
+ // A response to the fetch request was received.
+ kMetricTokenFetchResponseReceived,
+ // The response received was invalid. This happens when some expected data
+ // was not present in the response.
+ kMetricTokenFetchBadResponse,
+ // DM server reported that management is not supported.
+ kMetricTokenFetchManagementNotSupported,
+ // DM server reported that the given device ID was not found.
+ kMetricTokenFetchDeviceNotFound,
+ // DM token successfully retrieved.
+ kMetricTokenFetchOK,
+
+ // An attempt was made to cache a token to disk.
+ kMetricTokenStoreRequested,
+ // Caching a token to disk failed.
+ kMetricTokenStoreFailed,
+
+ kMetricTokenSize // Must be the last.
+};
+
+// Events related to fetching, saving and loading user and device policies.
+enum MetricPolicy {
+ // An attempt was made to load a locally cached policy.
+ kMetricPolicyLoadRequested = 0,
+ // Reading a cached policy from disk failed.
+ kMetricPolicyLoadFailed,
+
+ // A policy fetch request was sent to the DM server.
+ kMetricPolicyFetchRequested,
+ // The request was invalid, or the HTTP request failed.
+ kMetricPolicyFetchRequestFailed,
+ // Error HTTP status received, or the DM server failed in another way.
+ kMetricPolicyFetchServerFailed,
+ // Policy not found for the given user or device.
+ kMetricPolicyFetchNotFound,
+ // DM server didn't accept the token used in the request.
+ kMetricPolicyFetchInvalidToken,
+ // A response to the policy fetch request was received.
+ kMetricPolicyFetchResponseReceived,
+ // The policy response message didn't contain a policy, or other data was
+ // missing.
+ kMetricPolicyFetchBadResponse,
+ // Failed to decode the policy.
+ kMetricPolicyFetchInvalidPolicy,
+ // The device policy was rejected because its signature was invalid.
+ kMetricPolicyFetchBadSignature,
+ // Rejected policy because its timestamp is in the future.
+ kMetricPolicyFetchTimestampInFuture,
+ // Device policy rejected because the device is not managed.
+ kMetricPolicyFetchNonEnterpriseDevice,
+ // The policy was provided for a username that is different from the device
+ // owner, and the policy was rejected.
+ kMetricPolicyFetchUserMismatch,
+ // The policy was rejected for another reason. Currently this can happen
+ // only for device policies, when the SignedSettings fail to store or retrieve
+ // a stored policy.
+ kMetricPolicyFetchOtherFailed,
+ // The fetched policy was accepted.
+ kMetricPolicyFetchOK,
+ // The policy just fetched didn't have any changes compared to the cached
+ // policy.
+ kMetricPolicyFetchNotModified,
+
+ // An attempt was made to cache a policy to disk.
+ kMetricPolicyStoreRequested,
+ // Caching a policy to disk failed.
+ kMetricPolicyStoreFailed,
+
+ kMetricPolicySize // Must be the last.
+};
+
+// Events related to device enrollment.
+enum MetricEnrollment {
+ // The enrollment screen was closed without completing the enrollment
+ // process.
+ kMetricEnrollmentCancelled = 0,
+ // The user submitted credentials and started the enrollment process.
+ kMetricEnrollmentStarted,
+ // Enrollment failed due to a network error.
+ kMetricEnrollmentNetworkFailed,
+ // Enrollment failed because logging in to Gaia failed.
+ kMetricEnrollmentLoginFailed,
+ // Enrollment failed because it is not supported for the account used.
+ kMetricEnrollmentNotSupported,
+ // Enrollment failed because it failed to apply device policy.
+ kMetricEnrollmentPolicyFailed,
+ // Enrollment failed due to an unexpected error. This currently happens when
+ // the Gaia auth token is not issued for the DM service, the device cloud
+ // policy subsystem isn't initialized, or when fetching Gaia tokens fails
+ // for an unknown reason.
+ kMetricEnrollmentOtherFailed,
+ // Enrollment was successful.
+ kMetricEnrollmentOK,
+
+ kMetricEnrollmentSize // Must be the last.
+};
+
+// Names for the UMA counters. They are shared from here since the events
+// from the same enum above can be triggered in different files, and must use
+// the same UMA histogram name.
+extern const char kMetricToken[];
+extern const char kMetricPolicy[];
+extern const char kMetricEnrollment[];
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_POLICY_ENTERPRISE_METRICS_H_

Powered by Google App Engine
This is Rietveld 408576698