Commit 9533c07b authored by marja@chromium.org's avatar marja@chromium.org

Telemetry: Don't silently compare histograms from different processes.

We used to do so, and the resulting data doesn't make sense.

BUG=224262
NOTRY=true


Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=192526

Review URL: https://chromiumcodereview.appspot.com/13119014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192533 0039d316-1c4b-4281-b951-d872f2087c98
parent 54e38c41
......@@ -13,6 +13,7 @@
#include "base/metrics/histogram_samples.h"
#include "base/metrics/sparse_histogram.h"
#include "base/pickle.h"
#include "base/process_util.h"
#include "base/values.h"
namespace base {
......@@ -119,6 +120,7 @@ void HistogramBase::WriteJSON(std::string* output) const {
root.SetInteger("flags", flags());
root.Set("params", parameters.release());
root.Set("buckets", buckets.release());
root.SetInteger("pid", GetCurrentProcId());
serializer.Serialize(root);
}
......
......@@ -13,12 +13,18 @@ def SubtractHistogram(histogram_json, start_histogram_json):
if 'buckets' not in start_histogram:
return histogram_json
histogram = json.loads(histogram_json)
if ('pid' in start_histogram and 'pid' in histogram
and start_histogram['pid'] != histogram['pid']):
raise Exception(
'Trying to compare histograms from different processes (%d and %d)'
% (start_histogram['pid'], histogram['pid']))
start_histogram_buckets = dict()
for b in start_histogram['buckets']:
start_histogram_buckets[b['low']] = b['count']
new_buckets = []
histogram = json.loads(histogram_json)
for b in histogram['buckets']:
new_bucket = b
low = b['low']
......
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