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

Unified Diff: base/metrics/field_trial.h

Issue 9117037: Added a Unique ID for a Field Trial containing it's hashed name and the selected group ID. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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 | « no previous file | base/metrics/field_trial.cc » ('j') | base/metrics/field_trial.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/field_trial.h
===================================================================
--- base/metrics/field_trial.h (revision 118842)
+++ base/metrics/field_trial.h (working copy)
@@ -92,6 +92,9 @@
class BASE_EXPORT FieldTrial : public RefCounted<FieldTrial> {
public:
typedef int Probability; // Probability type for being selected in a trial.
+ // The Unique ID of a trial, first element is a hashed value of the name
+ // and the second one is the group identifier.
+ typedef std::pair<size_t, int> UID;
jar (doing other things) 2012/01/24 19:19:45 You might want to send two hashes, rather than one
MAD 2012/01/24 20:30:24 OK! Done... Thanks! :-)
// A return value to indicate that a given instance has not yet had a group
// assignment (and hence is not yet participating in the trial).
@@ -148,6 +151,10 @@
// number is used as the group name.
std::string group_name();
+ // Gets the unique identifier of the Field Trial, but only if a winner was
+ // elected. Returns true if a winner is returned, false otherwise.
+ bool GetUID(UID* uid);
+
// Return the default group name of the FieldTrial.
std::string default_group_name() const { return default_group_name_; }
@@ -285,11 +292,14 @@
// Create a persistent representation of all FieldTrial instances and the
// |client_id()| state for resurrection in another process. This allows
- // randomization to be done in one process, and secondary processes can by
+ // randomization to be done in one process, and secondary processes can be
// synchronized on the result. The resulting string contains the
// |client_id()|, the names, the trial name, and a "/" separator.
static void StatesToString(std::string* output);
+ // Returns an array of Unique IDs for each currently running Field Trials.
+ static void GetFieldTrialUIDs(std::vector<FieldTrial::UID>* uids);
+
// Use a previously generated state string (re: StatesToString()) augment the
// current list of field tests to include the supplied tests, and using a 100%
// probability for each test, force them to have the same group string. This
« no previous file with comments | « no previous file | base/metrics/field_trial.cc » ('j') | base/metrics/field_trial.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698