Commit a70ef7d9 authored by Steven Holte's avatar Steven Holte Committed by Commit Bot

Send variations seed version to UMA.

Update variations_seed proto and metrics protos, and send seed versions
to UMA, so it's available for analysis.

Change-Id: Id2954646c6c000af8accde3e43f1eedc9e5c1c1f
Reviewed-on: https://chromium-review.googlesource.com/c/1339242Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Steven Holte <holte@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610188}
parent 8a80e583
...@@ -45,6 +45,9 @@ void FieldTrialsProvider::OnDidCreateMetricsLog() { ...@@ -45,6 +45,9 @@ void FieldTrialsProvider::OnDidCreateMetricsLog() {
void FieldTrialsProvider::ProvideSystemProfileMetrics( void FieldTrialsProvider::ProvideSystemProfileMetrics(
metrics::SystemProfileProto* system_profile_proto) { metrics::SystemProfileProto* system_profile_proto) {
std::vector<ActiveGroupId> field_trial_ids; std::vector<ActiveGroupId> field_trial_ids;
const std::string& version = variations::GetSeedVersion();
if (!version.empty())
system_profile_proto->set_variations_seed_version(version);
GetFieldTrialIds(&field_trial_ids); GetFieldTrialIds(&field_trial_ids);
WriteFieldTrials(field_trial_ids, system_profile_proto); WriteFieldTrials(field_trial_ids, system_profile_proto);
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <vector> #include <vector>
#include "base/lazy_instance.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "components/variations/hashing.h" #include "components/variations/hashing.h"
...@@ -17,6 +18,8 @@ namespace variations { ...@@ -17,6 +18,8 @@ namespace variations {
namespace { namespace {
base::LazyInstance<std::string>::Leaky g_seed_version;
// Populates |name_group_ids| based on |active_groups|. Field trial names are // Populates |name_group_ids| based on |active_groups|. Field trial names are
// suffixed with |suffix| before hashing is executed. // suffixed with |suffix| before hashing is executed.
void GetFieldTrialActiveGroupIdsForActiveGroups( void GetFieldTrialActiveGroupIdsForActiveGroups(
...@@ -77,6 +80,14 @@ void GetSyntheticTrialGroupIdsAsString(std::vector<std::string>* output) { ...@@ -77,6 +80,14 @@ void GetSyntheticTrialGroupIdsAsString(std::vector<std::string>* output) {
AppendActiveGroupIdsAsStrings(name_group_ids, output); AppendActiveGroupIdsAsStrings(name_group_ids, output);
} }
void SetSeedVersion(const std::string& seed_version) {
g_seed_version.Get() = seed_version;
}
const std::string& GetSeedVersion() {
return g_seed_version.Get();
}
namespace testing { namespace testing {
void TestGetFieldTrialActiveGroupIds( void TestGetFieldTrialActiveGroupIds(
......
...@@ -63,6 +63,18 @@ void GetFieldTrialActiveGroupIdsAsStrings(base::StringPiece suffix, ...@@ -63,6 +63,18 @@ void GetFieldTrialActiveGroupIdsAsStrings(base::StringPiece suffix,
// which hasn't been chosen yet are NOT returned in this list. // which hasn't been chosen yet are NOT returned in this list.
void GetSyntheticTrialGroupIdsAsString(std::vector<std::string>* output); void GetSyntheticTrialGroupIdsAsString(std::vector<std::string>* output);
// Sets the version of the seed that the current set of FieldTrials was
// generated from.
// TODO(crbug/507665): Move this to field_trials_provider once it moves
// into components/variations
void SetSeedVersion(const std::string& seed_version);
// Gets the version of the seed that the current set of FieldTrials was
// generated from.
// TODO(crbug/507665): Move this to field_trials_provider once it moves
// into components/variations
const std::string& GetSeedVersion();
// Expose some functions for testing. These functions just wrap functionality // Expose some functions for testing. These functions just wrap functionality
// that is implemented above. // that is implemented above.
namespace testing { namespace testing {
......
...@@ -23,4 +23,8 @@ message VariationsSeed { ...@@ -23,4 +23,8 @@ message VariationsSeed {
// Lowercase ISO 3166-1 alpha-2 country code of the client, according to IP // Lowercase ISO 3166-1 alpha-2 country code of the client, according to IP
// address. Deprecated. // address. Deprecated.
optional string country_code = 3 [deprecated = true]; optional string country_code = 3 [deprecated = true];
// A version string which identifies the version of the configuration files
// that this seed was generated from.
optional string version = 4;
} }
...@@ -172,6 +172,7 @@ void VariationsSeedProcessor::CreateTrialsFromSeed( ...@@ -172,6 +172,7 @@ void VariationsSeedProcessor::CreateTrialsFromSeed(
base::FeatureList* feature_list) { base::FeatureList* feature_list) {
std::vector<ProcessedStudy> filtered_studies; std::vector<ProcessedStudy> filtered_studies;
FilterAndValidateStudies(seed, client_state, &filtered_studies); FilterAndValidateStudies(seed, client_state, &filtered_studies);
SetSeedVersion(seed.version());
for (const ProcessedStudy& study : filtered_studies) { for (const ProcessedStudy& study : filtered_studies) {
CreateTrialFromStudy(study, override_callback, low_entropy_provider, CreateTrialFromStudy(study, override_callback, low_entropy_provider,
......
Name: Metrics Protos Name: Metrics Protos
Short Name: metrics_proto Short Name: metrics_proto
URL: This is the canonical public repository URL: This is the canonical public repository
Version: 217960420 Version: 221728188
Date: 2018/10/20 UTC Date: 2018/11/16 UTC
License: BSD License: BSD
Security Critical: Yes Security Critical: Yes
......
...@@ -297,13 +297,16 @@ message OmniboxEventProto { ...@@ -297,13 +297,16 @@ message OmniboxEventProto {
// matched an open tab. // matched an open tab.
optional bool has_tab_match = 8; optional bool has_tab_match = 8;
// The Omnibox search provider generates 2 fundamental types of // Whether this suggestion came associated with a keyword. Does not include
// suggestions: Traditional search suggestions, which throw the terms // suggestions that came from the default search engine unless the search
// against the default search engine (DSE), and keyword search suggestions, // engine was explicitly invoked. As two common examples,
// which throw the terms against the search engine selected when the user // |is_keyword_suggestion| will be true for suggestions from explicitly-
// initiates keyword mode (which may also be the DSE). When // invoked suggestions (whether from a search engine or an extension). It
// |is_keyword_suggestion| is true, this suggestion originated from the // will also be true for suggestions from a keyword that wasn't explicitly
// latter. // requested. For example, if a user has Google as their default search
// engine, the input "bing testing" will often show a suggestion to "Search
// Bing for testing" in the dropdown. This suggestion will be marked as
// |is_keyword_suggestion|.
optional bool is_keyword_suggestion = 9; optional bool is_keyword_suggestion = 9;
} }
repeated Suggestion suggestion = 9; repeated Suggestion suggestion = 9;
......
...@@ -15,7 +15,7 @@ import "extension_install.proto"; ...@@ -15,7 +15,7 @@ import "extension_install.proto";
// Stores information about the user's brower and system configuration. // Stores information about the user's brower and system configuration.
// The system configuration fields are recorded once per client session. // The system configuration fields are recorded once per client session.
// Next tag: 28 // Next tag: 29
message SystemProfileProto { message SystemProfileProto {
// The time when the client was compiled/linked, in seconds since the epoch. // The time when the client was compiled/linked, in seconds since the epoch.
optional int64 build_timestamp = 1; optional int64 build_timestamp = 1;
...@@ -644,6 +644,10 @@ message SystemProfileProto { ...@@ -644,6 +644,10 @@ message SystemProfileProto {
} }
repeated FieldTrial field_trial = 9; repeated FieldTrial field_trial = 9;
// Seed version from variations_seed.proto used to instantiate FieldTrials
// for this session.
optional string variations_seed_version = 28;
// Information about the A/V output device(s) (typically just a TV). // Information about the A/V output device(s) (typically just a TV).
// However, a configuration may have one or more intermediate A/V devices // However, a configuration may have one or more intermediate A/V devices
// between the source device and the TV (e.g. an A/V receiver, video // between the source device and the TV (e.g. an A/V receiver, video
......
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