Commit 0feebc2e authored by Mark Pearson's avatar Mark Pearson Committed by Commit Bot

Metrics - Comment Some Functions about Process Restrictions

Some of these would get different types of data depending on the
process it is run from.

Does not comment all relevant functions, just the ones I noticed.

Change-Id: I4450624db96021d39dbc1fb11b41e7d2fa561d23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2519857
Commit-Queue: Mark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827055}
parent 75c633c5
......@@ -213,6 +213,16 @@ class BASE_EXPORT HistogramBase {
virtual uint32_t FindCorruption(const HistogramSamples& samples) const;
// Snapshot the current complete set of sample data.
// Note that histogram data is stored per-process. The browser process
// periodically injests data from subprocesses. As such, the browser
// process can see histogram data from any process but other processes
// can only see histogram data recorded in the subprocess.
// Moreover, the data returned here may not be up to date:
// - this function does not use a lock so data might not be synced
// (e.g., across cpu caches)
// - in the browser process, the data from subprocesses may not have
// synced data from subprocesses via MergeHistogramDeltas() recently.
//
// Override with atomic/locked snapshot if needed.
// NOTE: this data can overflow for long-running sessions. It should be
// handled with care and this method is recommended to be used only
......@@ -222,6 +232,8 @@ class BASE_EXPORT HistogramBase {
// Calculate the change (delta) in histogram counts since the previous call
// to this method. Each successive call will return only those counts
// changed since the last call.
//
// See additional caveats by SnapshotSamples().
virtual std::unique_ptr<HistogramSamples> SnapshotDelta() = 0;
// Calculate the change (delta) in histogram counts since the previous call
......@@ -231,6 +243,8 @@ class BASE_EXPORT HistogramBase {
// data previously returned. Because no internal data is changed, this call
// can be made on "const" histograms such as those with data held in
// read-only memory.
//
// See additional caveats by SnapshotSamples().
virtual std::unique_ptr<HistogramSamples> SnapshotFinalDelta() const = 0;
// The following method provides graphical histogram displays.
......
......@@ -39,7 +39,7 @@ class HistogramSnapshotManager;
//
// All the public methods are static and act on a global recorder. This global
// recorder is internally synchronized and all the static methods are thread
// safe.
// safe. This is intended to only be run/used in the browser process.
//
// StatisticsRecorder doesn't have any public constructor. For testing purpose,
// you can create a temporary recorder using the factory method
......
......@@ -71,6 +71,8 @@ void SetSeedVersion(const std::string& seed_version);
// Gets the version of the seed that the current set of FieldTrials was
// generated from.
// Only works on the browser process; returns the empty string from other
// processes.
// TODO(crbug/507665): Move this to field_trials_provider once it moves
// into components/variations
const std::string& GetSeedVersion();
......
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