Commit fa33d250 authored by ssid's avatar ssid Committed by Commit Bot

Add field trials data to tracing metrics provider

The tracing metrics provider now directly calls the field trials
provider to get the field trial data. This doesn't scale well for
additional system profile providers, but as we don't want to
automatically include the full system profile in all independent metrics
and we don't currently have a way of selectively including this, for now
we manually populate the field trials data

Change-Id: I6397f6500470d719987e54f9c038f50daad58556
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2024162
Commit-Queue: ssid <ssid@chromium.org>
Reviewed-by: default avataroysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736067}
parent 78d1ce71
......@@ -6,6 +6,9 @@
#include <utility>
#include "base/strings/string_piece.h"
#include "base/time/time.h"
#include "components/metrics/field_trials_provider.h"
#include "content/public/browser/background_tracing_manager.h"
#include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h"
#include "third_party/metrics_proto/trace_log.pb.h"
......@@ -35,6 +38,13 @@ void BackgroundTracingMetricsProvider::ProvideIndependentMetrics(
}
metrics::TraceLog* log = uma_proto->add_trace_log();
log->set_raw_data(std::move(serialized_trace));
// TODO(ssid): Find a better way to record other system profile metrics in
// independent providers.
variations::FieldTrialsProvider provider(nullptr, base::StringPiece());
provider.ProvideSystemProfileMetricsWithLogCreationTime(
base::TimeTicks(), uma_proto->mutable_system_profile());
std::move(done_callback).Run(true);
}
......
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