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

Unified Diff: base/metrics/field_trial.cc

Issue 2453093002: Create FieldTrialAllocator.Size histogram (Closed)
Patch Set: forgot to remove todos Created 4 years, 2 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 | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/field_trial.cc
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc
index 9f8a21265550f311b24f4ad1084173f843e7e70c..bb6ae0cb83fd02fa52b8d17584ee911fcef105ca 100644
--- a/base/metrics/field_trial.cc
+++ b/base/metrics/field_trial.cc
@@ -12,6 +12,7 @@
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
#include "base/process/memory.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
@@ -54,7 +55,6 @@ const size_t kFieldTrialAllocationSize = 4 << 10; // 4 KiB = one page
// ---------------------------------
// | fte | trial_name | group_name |
// ---------------------------------
-// TODO(lawrencewu): Actually update the activated flag.
struct FieldTrialEntry {
bool activated;
uint32_t group_name_offset;
@@ -705,6 +705,8 @@ void FieldTrialList::CopyFieldTrialStateToFlags(
std::to_string(field_trial_length);
cmd_line->AppendSwitchASCII(field_trial_handle_switch, field_trial_handle);
+ UMA_HISTOGRAM_COUNTS_10000("UMA.FieldTrialAllocator.Size",
+ field_trial_length);
return;
}
#endif
@@ -829,8 +831,6 @@ void FieldTrialList::InstantiateFieldTrialAllocatorIfNeeded() {
if (!shm->CreateAndMapAnonymous(kFieldTrialAllocationSize))
TerminateBecauseOutOfMemory(kFieldTrialAllocationSize);
- // TODO(lawrencewu): call UpdateTrackingHistograms() when all field trials
- // have been registered (perhaps in the destructor?)
global_->field_trial_allocator_.reset(new SharedPersistentMemoryAllocator(
std::move(shm), 0, kAllocatorName, false));
global_->field_trial_allocator_->CreateTrackingHistograms(kAllocatorName);
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698