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

Issue 1880803003: Display histograms from subprocesses in chrome://histograms (Closed)

Created:
4 years, 8 months ago by bcwhite
Modified:
4 years, 4 months ago
Reviewers:
Ilya Sherman
CC:
chromium-reviews, asvitkine+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Display histograms from subprocesses in chrome://histograms Traditionally, metrics in subprocesses were imported into the browser process and so were known to the Statistics- Recorder and would appear on the chrome://histograms page. With the move to metrics held in persistent memory segments from which the data is independently included in the upload, histograms in subprocesses disappeared from that page. Allow classes to register themselves with the Statistics- Recorder using an interface that can write histogram graphs to an output stream. The SubprocessMetricsProvider registers itself during construction with the result being a separate section on the page for histograms from sub- processes. The core Write(HTML)Graph methods are modified to take an optional snapshot. This allows passing a merged snapshot to the correct code to create the appropriate graph. BUG=602295

Patch Set 1 #

Patch Set 2 : change static set<MetricsDisplay*> into LazyInstance #

Patch Set 3 : include recently-exited processes in report #

Patch Set 4 : rebased #

Total comments: 14

Patch Set 5 : addressed review comments by Ilya #

Patch Set 6 : rebased #

Total comments: 46

Patch Set 7 : addressed review comments by Ilya #

Patch Set 8 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+275 lines, -66 lines) Patch
M base/metrics/histogram.h View 1 2 3 4 5 6 7 2 chunks +5 lines, -2 lines 0 comments Download
M base/metrics/histogram.cc View 1 2 3 4 5 6 7 2 chunks +16 lines, -7 lines 0 comments Download
M base/metrics/histogram_base.h View 1 2 3 4 5 6 7 1 chunk +7 lines, -3 lines 0 comments Download
M base/metrics/sparse_histogram.h View 1 2 3 4 5 6 7 2 chunks +5 lines, -2 lines 0 comments Download
M base/metrics/sparse_histogram.cc View 1 2 3 4 5 6 7 2 chunks +14 lines, -6 lines 0 comments Download
M base/metrics/statistics_recorder.h View 1 2 3 4 5 2 chunks +26 lines, -0 lines 0 comments Download
M base/metrics/statistics_recorder.cc View 1 2 3 4 5 5 chunks +34 lines, -2 lines 0 comments Download
M chrome/browser/metrics/subprocess_metrics_provider.h View 1 2 3 4 5 6 6 chunks +31 lines, -9 lines 0 comments Download
M chrome/browser/metrics/subprocess_metrics_provider.cc View 1 2 3 4 5 6 6 chunks +137 lines, -35 lines 0 comments Download

Messages

Total messages: 28 (13 generated)
bcwhite
4 years, 8 months ago (2016-04-12 14:39:07 UTC) #3
Ilya Sherman
https://codereview.chromium.org/1880803003/diff/100001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1880803003/diff/100001/base/metrics/histogram.cc#newcode469 base/metrics/histogram.cc:469: WriteAsciiImpl(true, "<br>", static_cast<const SampleVector*>(snapshot), Hmm, I'm not super happy ...
4 years, 8 months ago (2016-04-13 00:29:33 UTC) #4
bcwhite
https://codereview.chromium.org/1880803003/diff/100001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1880803003/diff/100001/base/metrics/histogram.cc#newcode469 base/metrics/histogram.cc:469: WriteAsciiImpl(true, "<br>", static_cast<const SampleVector*>(snapshot), On 2016/04/13 00:29:32, Ilya Sherman ...
4 years, 8 months ago (2016-04-13 11:58:18 UTC) #8
Ilya Sherman
Sorry for the delay here, Brian. I want to think through this more carefully, and ...
4 years, 8 months ago (2016-04-19 00:58:57 UTC) #9
bcwhite
On 2016/04/19 00:58:57, Ilya Sherman wrote: > Sorry for the delay here, Brian. I want ...
4 years, 8 months ago (2016-04-20 00:28:06 UTC) #11
Ilya Sherman
Hokay, I've now caught myself up on this code, and finally have another round of ...
4 years, 7 months ago (2016-04-25 20:53:15 UTC) #12
bcwhite
https://codereview.chromium.org/1880803003/diff/240001/base/metrics/statistics_recorder.cc File base/metrics/statistics_recorder.cc (right): https://codereview.chromium.org/1880803003/diff/240001/base/metrics/statistics_recorder.cc#newcode34 base/metrics/statistics_recorder.cc:34: g_metrics_displayers_ = LAZY_INSTANCE_INITIALIZER; On 2016/04/25 20:53:14, Ilya Sherman wrote: ...
4 years, 7 months ago (2016-04-26 19:51:54 UTC) #15
Ilya Sherman
https://codereview.chromium.org/1880803003/diff/240001/base/metrics/statistics_recorder.cc File base/metrics/statistics_recorder.cc (right): https://codereview.chromium.org/1880803003/diff/240001/base/metrics/statistics_recorder.cc#newcode34 base/metrics/statistics_recorder.cc:34: g_metrics_displayers_ = LAZY_INSTANCE_INITIALIZER; On 2016/04/26 19:51:53, bcwhite wrote: > ...
4 years, 7 months ago (2016-04-26 20:21:58 UTC) #16
bcwhite
https://codereview.chromium.org/1880803003/diff/240001/base/metrics/statistics_recorder.cc File base/metrics/statistics_recorder.cc (right): https://codereview.chromium.org/1880803003/diff/240001/base/metrics/statistics_recorder.cc#newcode34 base/metrics/statistics_recorder.cc:34: g_metrics_displayers_ = LAZY_INSTANCE_INITIALIZER; On 2016/04/26 20:21:58, Ilya Sherman wrote: ...
4 years, 7 months ago (2016-04-26 21:03:30 UTC) #17
Ilya Sherman
https://codereview.chromium.org/1880803003/diff/240001/base/metrics/statistics_recorder.cc File base/metrics/statistics_recorder.cc (right): https://codereview.chromium.org/1880803003/diff/240001/base/metrics/statistics_recorder.cc#newcode232 base/metrics/statistics_recorder.cc:232: std::string* output) { On 2016/04/26 21:03:29, bcwhite wrote: > ...
4 years, 7 months ago (2016-04-27 20:17:42 UTC) #18
bcwhite
https://codereview.chromium.org/1880803003/diff/240001/chrome/browser/metrics/subprocess_metrics_provider.cc File chrome/browser/metrics/subprocess_metrics_provider.cc (right): https://codereview.chromium.org/1880803003/diff/240001/chrome/browser/metrics/subprocess_metrics_provider.cc#newcode33 chrome/browser/metrics/subprocess_metrics_provider.cc:33: std::string& graph = graphs_[histogram.histogram_name()]; On 2016/04/27 20:17:42, Ilya Sherman ...
4 years, 7 months ago (2016-05-02 13:20:34 UTC) #19
Ilya Sherman
Continuing discussion of this somewhat tangential point, but FYI I'm mainly waiting for the change ...
4 years, 7 months ago (2016-05-04 06:00:26 UTC) #20
bcwhite
I started on removing the lock but hit a snag and moved onto other things ...
4 years, 7 months ago (2016-05-04 15:38:08 UTC) #21
bcwhite
> I started on removing the lock but hit a snag and moved onto other ...
4 years, 7 months ago (2016-05-04 19:58:01 UTC) #22
Ilya Sherman
4 years, 7 months ago (2016-05-05 07:01:55 UTC) #23
On 2016/05/04 15:38:08, bcwhite wrote:
> I started on removing the lock but hit a snag and moved onto other things for
a
> bit.
> 
> At histogram_internals_request_job.cc:54 is the call to WriteHTMLGraph() which
> fills the "data" parameter that is then returned.
> 
> Within content/, how do I make that call on the UI thread and block until it
> completes?

HistogramInternalsRequestJob::GetData() is passed a callback, which is what
should be invoked for the asynchronous work.  You can use content::BrowserThread
APIs to post the task to the UI thread.  Nothing should block.

Powered by Google App Engine
This is Rietveld 408576698