Commit 47146ebf authored by bauerb's avatar bauerb Committed by Commit bot

Add metrics for supervised user whitelist installation and uninstallation, and absolute count.

BUG=436459

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

Cr-Commit-Position: refs/heads/master@{#315235}
parent 76e4425f
......@@ -9,6 +9,8 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/metrics/histogram.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/prefs/pref_service.h"
#include "base/prefs/scoped_user_pref_update.h"
#include "base/strings/string_split.h"
......@@ -61,6 +63,7 @@ void SupervisedUserWhitelistService::Init() {
bool new_installation = false;
RegisterWhitelist(it.key(), name, new_installation);
}
UMA_HISTOGRAM_COUNTS_100("ManagedUsers.Whitelist.Count", whitelists->size());
// Register whitelists specified on the command line.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
......@@ -257,6 +260,8 @@ syncer::SyncError SupervisedUserWhitelistService::ProcessSyncChanges(
void SupervisedUserWhitelistService::AddNewWhitelist(
base::DictionaryValue* pref_dict,
const sync_pb::ManagedUserWhitelistSpecifics& whitelist) {
base::RecordAction(base::UserMetricsAction("ManagedUsers_Whitelist_Added"));
bool new_installation = true;
RegisterWhitelist(whitelist.id(), whitelist.name(), new_installation);
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
......@@ -273,6 +278,8 @@ void SupervisedUserWhitelistService::SetWhitelistProperties(
void SupervisedUserWhitelistService::RemoveWhitelist(
base::DictionaryValue* pref_dict,
const std::string& id) {
base::RecordAction(base::UserMetricsAction("ManagedUsers_Whitelist_Removed"));
pref_dict->RemoveWithoutPathExpansion(id, NULL);
installer_->UnregisterWhitelist(id);
UnloadWhitelist(id);
......
......@@ -7113,6 +7113,24 @@ should be able to be added at any place in this file.
<description>Please enter the description of this user action.</description>
</action>
<action name="ManagedUsers_Whitelist_Added">
<owner>bauerb@chromium.org</owner>
<owner>treib@chromium.org</owner>
<owner>pam@chromium.org</owner>
<description>
A new whitelist has been installed for a supervised user.
</description>
</action>
<action name="ManagedUsers_Whitelist_Removed">
<owner>bauerb@chromium.org</owner>
<owner>treib@chromium.org</owner>
<owner>pam@chromium.org</owner>
<description>
A whitelist has been uninstalled for a supervised user.
</description>
</action>
<action name="MaxButton_Clk_ExitFS">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description>
......
......@@ -12314,6 +12314,16 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
<histogram name="ManagedUsers.Whitelist.Count" units="whitelists">
<owner>bauerb@chromium.org</owner>
<owner>treib@chromium.org</owner>
<owner>pam@chromium.org</owner>
<summary>
The number of whitelists installed for a supervised user. Recorded at every
profile startup.
</summary>
</histogram>
<histogram name="ManagedUsers.Whitelist.JsonParseDuration" units="milliseconds">
<owner>bauerb@chromium.org</owner>
<owner>treib@chromium.org</owner>
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