Commit 00c5180f authored by xunjieli's avatar xunjieli Committed by Commit bot

Added the list of active field groups to NetLog dump

This CL adds a list of active field groups to NetLog dump. The string
representation is human readable, in the form of trial_name:group_name.

BUG=426474

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

Cr-Commit-Position: refs/heads/master@{#301104}
parent d16f44e6
...@@ -63,6 +63,12 @@ ...@@ -63,6 +63,12 @@
<th>Command line</th> <th>Command line</th>
<td><pre jscontent="constants.clientInfo.command_line"></pre></td> <td><pre jscontent="constants.clientInfo.command_line"></pre></td>
</tr> </tr>
<tr>
<th>Active Field Trial Groups</th>
<td>
<span jsselect="constants.activeFieldTrialGroups" jscontent="$this + ' '"></span>
</td>
</tr>
<tr> <tr>
<th>User comments</th> <th>User comments</th>
<td> <td>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/json/json_writer.h" #include "base/json/json_writer.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/values.h" #include "base/values.h"
#include "net/base/address_family.h" #include "net/base/address_family.h"
...@@ -258,6 +259,20 @@ base::DictionaryValue* NetLogLogger::GetConstants() { ...@@ -258,6 +259,20 @@ base::DictionaryValue* NetLogLogger::GetConstants() {
// Provide a default empty value for compatibility. // Provide a default empty value for compatibility.
constants_dict->Set("clientInfo", new base::DictionaryValue()); constants_dict->Set("clientInfo", new base::DictionaryValue());
// Add a list of active field experiments.
{
base::FieldTrial::ActiveGroups active_groups;
base::FieldTrialList::GetActiveFieldTrialGroups(&active_groups);
base::ListValue* field_trial_groups = new base::ListValue();
for (base::FieldTrial::ActiveGroups::const_iterator it =
active_groups.begin();
it != active_groups.end(); ++it) {
field_trial_groups->AppendString(it->trial_name + ":" +
it->group_name);
}
constants_dict->Set("activeFieldTrialGroups", field_trial_groups);
}
return constants_dict; return constants_dict;
} }
......
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