Commit 6139b8bc authored by tnagel@chromium.org's avatar tnagel@chromium.org

Fix EnterpriseDeviceManagementStatus UMA enum, add comments.

I've gone through the enterprise UMA enums and compared them to their C++
counterparts.  There was a mismatch for EnterpriseDeviceManagementStatus which
is corrected by this CL.  To prevent this kind of error in the future, this CL
adds comments and numeric ids to the C++ enums.

BUG=none

Review URL: https://codereview.chromium.org/375903002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283571 0039d316-1c4b-4281-b951-d872f2087c98
parent ed42a1e7
...@@ -69,37 +69,41 @@ enum UserAffiliation { ...@@ -69,37 +69,41 @@ enum UserAffiliation {
}; };
// Status codes for communication errors with the device management service. // Status codes for communication errors with the device management service.
// This enum is used to define the buckets for an enumerated UMA histogram.
// Hence,
// (a) existing enumerated constants should never be deleted or reordered, and
// (b) new constants should only be appended at the end of the enumeration.
enum DeviceManagementStatus { enum DeviceManagementStatus {
// All is good. // All is good.
DM_STATUS_SUCCESS, DM_STATUS_SUCCESS = 0,
// Request payload invalid. // Request payload invalid.
DM_STATUS_REQUEST_INVALID, DM_STATUS_REQUEST_INVALID = 1,
// The HTTP request failed. // The HTTP request failed.
DM_STATUS_REQUEST_FAILED, DM_STATUS_REQUEST_FAILED = 2,
// The server returned an error code that points to a temporary problem. // The server returned an error code that points to a temporary problem.
DM_STATUS_TEMPORARY_UNAVAILABLE, DM_STATUS_TEMPORARY_UNAVAILABLE = 3,
// The HTTP request returned a non-success code. // The HTTP request returned a non-success code.
DM_STATUS_HTTP_STATUS_ERROR, DM_STATUS_HTTP_STATUS_ERROR = 4,
// Response could not be decoded. // Response could not be decoded.
DM_STATUS_RESPONSE_DECODING_ERROR, DM_STATUS_RESPONSE_DECODING_ERROR = 5,
// Service error: Management not supported. // Service error: Management not supported.
DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED, DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED = 6,
// Service error: Device not found. // Service error: Device not found.
DM_STATUS_SERVICE_DEVICE_NOT_FOUND, DM_STATUS_SERVICE_DEVICE_NOT_FOUND = 7,
// Service error: Device token invalid. // Service error: Device token invalid.
DM_STATUS_SERVICE_MANAGEMENT_TOKEN_INVALID, DM_STATUS_SERVICE_MANAGEMENT_TOKEN_INVALID = 8,
// Service error: Activation pending. // Service error: Activation pending.
DM_STATUS_SERVICE_ACTIVATION_PENDING, DM_STATUS_SERVICE_ACTIVATION_PENDING = 9,
// Service error: The serial number is not valid or not known to the server. // Service error: The serial number is not valid or not known to the server.
DM_STATUS_SERVICE_INVALID_SERIAL_NUMBER, DM_STATUS_SERVICE_INVALID_SERIAL_NUMBER = 10,
// Service error: The device id used for registration is already taken. // Service error: The device id used for registration is already taken.
DM_STATUS_SERVICE_DEVICE_ID_CONFLICT, DM_STATUS_SERVICE_DEVICE_ID_CONFLICT = 11,
// Service error: The licenses have expired or have been exhausted. // Service error: The licenses have expired or have been exhausted.
DM_STATUS_SERVICE_MISSING_LICENSES, DM_STATUS_SERVICE_MISSING_LICENSES = 12,
// Service error: The administrator has deprovisioned this client. // Service error: The administrator has deprovisioned this client.
DM_STATUS_SERVICE_DEPROVISIONED, DM_STATUS_SERVICE_DEPROVISIONED = 13,
// Service error: Device registration for the wrong domain. // Service error: Device registration for the wrong domain.
DM_STATUS_SERVICE_DOMAIN_MISMATCH, DM_STATUS_SERVICE_DOMAIN_MISMATCH = 14,
// Service error: Policy not found. Error code defined by the DM folks. // Service error: Policy not found. Error code defined by the DM folks.
DM_STATUS_SERVICE_POLICY_NOT_FOUND = 902, DM_STATUS_SERVICE_POLICY_NOT_FOUND = 902,
}; };
......
...@@ -22,23 +22,23 @@ enum PolicyLoadStatus { ...@@ -22,23 +22,23 @@ enum PolicyLoadStatus {
// Policy load attempt started. This gets logged for each policy load attempt // Policy load attempt started. This gets logged for each policy load attempt
// to get a baseline on the number of requests, and an arbitrary number of // to get a baseline on the number of requests, and an arbitrary number of
// the below status codes may get added in addition. // the below status codes may get added in addition.
POLICY_LOAD_STATUS_STARTED, POLICY_LOAD_STATUS_STARTED = 0,
// System failed to determine whether there's policy. // System failed to determine whether there's policy.
POLICY_LOAD_STATUS_QUERY_FAILED, POLICY_LOAD_STATUS_QUERY_FAILED = 1,
// No policy present. // No policy present.
POLICY_LOAD_STATUS_NO_POLICY, POLICY_LOAD_STATUS_NO_POLICY = 2,
// Data inaccessible, such as non-local policy file. // Data inaccessible, such as non-local policy file.
POLICY_LOAD_STATUS_INACCCESSIBLE, POLICY_LOAD_STATUS_INACCCESSIBLE = 3,
// Data missing, such as policy file not present. // Data missing, such as policy file not present.
POLICY_LOAD_STATUS_MISSING, POLICY_LOAD_STATUS_MISSING = 4,
// Trying with Wow64 redirection disabled. // Trying with Wow64 redirection disabled.
POLICY_LOAD_STATUS_WOW64_REDIRECTION_DISABLED, POLICY_LOAD_STATUS_WOW64_REDIRECTION_DISABLED = 5,
// Data read error, for example file reading errors. // Data read error, for example file reading errors.
POLICY_LOAD_STATUS_READ_ERROR, POLICY_LOAD_STATUS_READ_ERROR = 6,
// Data too large to process. // Data too large to process.
POLICY_LOAD_STATUS_TOO_BIG, POLICY_LOAD_STATUS_TOO_BIG = 7,
// Parse error. // Parse error.
POLICY_LOAD_STATUS_PARSE_ERROR, POLICY_LOAD_STATUS_PARSE_ERROR = 8,
// This must stay last. // This must stay last.
POLICY_LOAD_STATUS_SIZE POLICY_LOAD_STATUS_SIZE
......
...@@ -77,10 +77,14 @@ GUID kRegistrySettingsCSEGUID = REGISTRY_EXTENSION_GUID; ...@@ -77,10 +77,14 @@ GUID kRegistrySettingsCSEGUID = REGISTRY_EXTENSION_GUID;
// The list of possible errors that can occur while collecting information about // The list of possible errors that can occur while collecting information about
// the current enterprise environment. // the current enterprise environment.
// This enum is used to define the buckets for an enumerated UMA histogram.
// Hence,
// (a) existing enumerated constants should never be deleted or reordered, and
// (b) new constants should only be appended at the end of the enumeration.
enum DomainCheckErrors { enum DomainCheckErrors {
DOMAIN_CHECK_ERROR_GET_JOIN_INFO = 0, DOMAIN_CHECK_ERROR_GET_JOIN_INFO = 0,
DOMAIN_CHECK_ERROR_DS_BIND, DOMAIN_CHECK_ERROR_DS_BIND = 1,
DOMAIN_CHECK_ERROR_LAST, DOMAIN_CHECK_ERROR_SIZE, // Not a DomainCheckError. Must be last.
}; };
// If the LBS extension is found and contains a schema in the registry then this // If the LBS extension is found and contains a schema in the registry then this
...@@ -304,7 +308,7 @@ void CollectEnterpriseUMAs() { ...@@ -304,7 +308,7 @@ void CollectEnterpriseUMAs() {
if (NERR_Success != ::NetGetJoinInformation(NULL, &domain, &join_status)) { if (NERR_Success != ::NetGetJoinInformation(NULL, &domain, &join_status)) {
UMA_HISTOGRAM_ENUMERATION("EnterpriseCheck.DomainCheckFailed", UMA_HISTOGRAM_ENUMERATION("EnterpriseCheck.DomainCheckFailed",
DOMAIN_CHECK_ERROR_GET_JOIN_INFO, DOMAIN_CHECK_ERROR_GET_JOIN_INFO,
DOMAIN_CHECK_ERROR_LAST); DOMAIN_CHECK_ERROR_SIZE);
return; return;
} }
::NetApiBufferFree(domain); ::NetApiBufferFree(domain);
...@@ -321,7 +325,7 @@ void CollectEnterpriseUMAs() { ...@@ -321,7 +325,7 @@ void CollectEnterpriseUMAs() {
} else { } else {
UMA_HISTOGRAM_ENUMERATION("EnterpriseCheck.DomainCheckFailed", UMA_HISTOGRAM_ENUMERATION("EnterpriseCheck.DomainCheckFailed",
DOMAIN_CHECK_ERROR_DS_BIND, DOMAIN_CHECK_ERROR_DS_BIND,
DOMAIN_CHECK_ERROR_LAST); DOMAIN_CHECK_ERROR_SIZE);
} }
} }
} }
......
...@@ -37027,6 +37027,10 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -37027,6 +37027,10 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</enum> </enum>
<enum name="EnterpriseCheckError" type="int"> <enum name="EnterpriseCheckError" type="int">
<summary>
Defined as DomainCheckErrors in
components/policy/core/common/policy_loader_win.cc.
</summary>
<int value="0" label="Cound not get net join info."/> <int value="0" label="Cound not get net join info."/>
<int value="1" label="Cound not bind to domain controller."/> <int value="1" label="Cound not bind to domain controller."/>
</enum> </enum>
...@@ -37034,7 +37038,8 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -37034,7 +37038,8 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<enum name="EnterpriseDeviceManagementStatus" type="int"> <enum name="EnterpriseDeviceManagementStatus" type="int">
<summary> <summary>
Status codes produced by DeviceManagementService for requests made to the Status codes produced by DeviceManagementService for requests made to the
device management server. device management server as defined in
components/policy/core/common/cloud/cloud_policy_constants.h.
</summary> </summary>
<int value="0" label="SUCCESS"/> <int value="0" label="SUCCESS"/>
<int value="1" label="REQUEST_INVALID"/> <int value="1" label="REQUEST_INVALID"/>
...@@ -37049,13 +37054,15 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -37049,13 +37054,15 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="10" label="SERVICE_INVALID_SERIAL_NUMBER"/> <int value="10" label="SERVICE_INVALID_SERIAL_NUMBER"/>
<int value="11" label="SERVICE_DEVICE_ID_CONFLICT"/> <int value="11" label="SERVICE_DEVICE_ID_CONFLICT"/>
<int value="12" label="SERVICE_MISSING_LICENSES"/> <int value="12" label="SERVICE_MISSING_LICENSES"/>
<int value="13" label="SERVICE_DEPROVISIONED"/>
<int value="14" label="SERVICE_DOMAIN_MISMATCH"/>
<int value="902" label="SERVICE_POLICY_NOT_FOUND"/> <int value="902" label="SERVICE_POLICY_NOT_FOUND"/>
</enum> </enum>
<enum name="EnterpriseDMTokenType" type="int"> <enum name="EnterpriseDMTokenType" type="int">
<summary> <summary>
Result of DMToken operations as defined in Result of DMToken operations as defined in
chrome/browser/policy/enterprise_metrics.h. components/policy/core/common/cloud/enterprise_metrics.h.
</summary> </summary>
<int value="0" label="Load Succeeded"> <int value="0" label="Load Succeeded">
A cached token was successfully loaded from disk. A cached token was successfully loaded from disk.
...@@ -37102,7 +37109,7 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -37102,7 +37109,7 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<enum name="EnterpriseEnrollmentType" type="int"> <enum name="EnterpriseEnrollmentType" type="int">
<summary> <summary>
Result of device enrollment as defined in Result of device enrollment as defined in
chrome/browser/policy/enterprise_metrics.h. components/policy/core/common/cloud/enterprise_metrics.h.
</summary> </summary>
<int value="0" label="Cancelled"> <int value="0" label="Cancelled">
The enrollment screen was closed without completing the enrollment process. The enrollment screen was closed without completing the enrollment process.
...@@ -37531,6 +37538,10 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -37531,6 +37538,10 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</enum> </enum>
<enum name="EnterprisePolicyInvalidations" type="int"> <enum name="EnterprisePolicyInvalidations" type="int">
<summary>
Defined as PolicyInvalidationType in
components/policy/core/common/cloud/enterprise_metrics.h.
</summary>
<int value="0" label="No payload; not expired"/> <int value="0" label="No payload; not expired"/>
<int value="1" label="Payload; not expired"/> <int value="1" label="Payload; not expired"/>
<int value="2" label="No payload; expired"/> <int value="2" label="No payload; expired"/>
...@@ -37541,7 +37552,8 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -37541,7 +37552,8 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<summary> <summary>
Status codes produced by the policy loaders that pull policy settings from Status codes produced by the policy loaders that pull policy settings from
the platform-specific management infrastructure, such as Windows Group the platform-specific management infrastructure, such as Windows Group
Policy. Policy. Defined as PolicyLoadStatus in
components/policy/core/common/policy_load_status.h.
</summary> </summary>
<int value="0" label="STARTED"> <int value="0" label="STARTED">
Policy load attempt started. This gets logged for each policy load attempt Policy load attempt started. This gets logged for each policy load attempt
...@@ -37569,6 +37581,10 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -37569,6 +37581,10 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</enum> </enum>
<enum name="EnterprisePolicyRefresh" type="int"> <enum name="EnterprisePolicyRefresh" type="int">
<summary>
Defined as MetricPolicyRefresh in
components/policy/core/common/cloud/enterprise_metrics.h.
</summary>
<int value="0" label="Changed"/> <int value="0" label="Changed"/>
<int value="1" label="Changed; Invalidations disabled"/> <int value="1" label="Changed; Invalidations disabled"/>
<int value="2" label="Unchanged"/> <int value="2" label="Unchanged"/>
...@@ -37578,8 +37594,8 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -37578,8 +37594,8 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<enum name="EnterprisePolicyType" type="int"> <enum name="EnterprisePolicyType" type="int">
<summary> <summary>
Result of Policy operations as defined in Result of Policy operations as defined as MetricPolicy in
chrome/browser/policy/enterprise_metrics.h. components/policy/core/common/cloud/enterprise_metrics.h.
</summary> </summary>
<int value="0" label="Load Succeeded"> <int value="0" label="Load Succeeded">
A cached policy was successfully loaded from disk. A cached policy was successfully loaded from disk.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment