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

Issue 6869034: Factor a scheduler object out of MetricsService. (Closed)

Created:
9 years, 8 months ago by stuartmorgan
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Factor a scheduler object out of MetricsService. The logic for when to upload is now separate from the core of MetricsService. For now the object is internally constructed so that the MetricsService interface doesn't change, but it could easily be pulled out later if we need DI-style construction. Fixes a bug where backoff for server errors would be bypassed if the logs were large. Also removes a bit of dead code I missed when removing the server response parsing in the last CL. BUG=None TEST=Metrics continue to show up on the dashboards unchanged. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82299

Patch Set 1 #

Patch Set 2 : Comment fix #

Total comments: 18

Patch Set 3 : Address most review comments #

Total comments: 3

Patch Set 4 : Switch from friend to Callback #

Patch Set 5 : Rebased to trunk #

Unified diffs Side-by-side diffs Delta from patch set Stats (+269 lines, -186 lines) Patch
A chrome/browser/metrics/metrics_reporting_scheduler.h View 1 2 3 1 chunk +68 lines, -0 lines 0 comments Download
A chrome/browser/metrics/metrics_reporting_scheduler.cc View 1 2 3 1 chunk +111 lines, -0 lines 0 comments Download
M chrome/browser/metrics/metrics_service.h View 1 2 3 4 7 chunks +16 lines, -32 lines 0 comments Download
M chrome/browser/metrics/metrics_service.cc View 1 2 3 4 20 chunks +72 lines, -154 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
stuartmorgan
9 years, 8 months ago (2011-04-15 23:08:13 UTC) #1
jar (doing other things)
http://codereview.chromium.org/6869034/diff/2001/chrome/browser/metrics/metrics_reporting_scheduler.cc File chrome/browser/metrics/metrics_reporting_scheduler.cc (right): http://codereview.chromium.org/6869034/diff/2001/chrome/browser/metrics/metrics_reporting_scheduler.cc#newcode43 chrome/browser/metrics/metrics_reporting_scheduler.cc:43: MetricsReportingScheduler::~MetricsReportingScheduler() {} Why bother with a destructor? ...or at ...
9 years, 8 months ago (2011-04-16 02:03:13 UTC) #2
stuartmorgan
http://codereview.chromium.org/6869034/diff/2001/chrome/browser/metrics/metrics_reporting_scheduler.cc File chrome/browser/metrics/metrics_reporting_scheduler.cc (right): http://codereview.chromium.org/6869034/diff/2001/chrome/browser/metrics/metrics_reporting_scheduler.cc#newcode43 chrome/browser/metrics/metrics_reporting_scheduler.cc:43: MetricsReportingScheduler::~MetricsReportingScheduler() {} On 2011/04/16 02:03:13, jar wrote: > Why ...
9 years, 8 months ago (2011-04-18 17:03:00 UTC) #3
jar (doing other things)
LGTM Please (assuming I understand) at least do the minimal code-motion of moving up lines ...
9 years, 8 months ago (2011-04-18 22:06:27 UTC) #4
stuartmorgan
http://codereview.chromium.org/6869034/diff/7001/chrome/browser/metrics/metrics_service.cc File chrome/browser/metrics/metrics_service.cc (right): http://codereview.chromium.org/6869034/diff/7001/chrome/browser/metrics/metrics_service.cc#newcode935 chrome/browser/metrics/metrics_service.cc:935: for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); On 2011/04/18 22:06:27, jar wrote: > ...
9 years, 8 months ago (2011-04-19 16:14:19 UTC) #5
sail
http://codereview.chromium.org/6869034/diff/7001/chrome/browser/metrics/metrics_service.cc File chrome/browser/metrics/metrics_service.cc (right): http://codereview.chromium.org/6869034/diff/7001/chrome/browser/metrics/metrics_service.cc#newcode935 chrome/browser/metrics/metrics_service.cc:935: for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); On 2011/04/19 16:14:19, stuartmorgan wrote: > ...
9 years, 8 months ago (2011-04-19 16:26:23 UTC) #6
stuartmorgan
On 2011/04/19 16:26:23, sail wrote: > Sorry, it looks like a mistake. Here's the review: ...
9 years, 8 months ago (2011-04-19 16:38:56 UTC) #7
stuartmorgan
I'll hold off on landing this until the revert of that CL is in so ...
9 years, 8 months ago (2011-04-19 17:23:47 UTC) #8
jar (doing other things)
I spoke to sail@, and he'll do the revert. Please do wait until the revert ...
9 years, 8 months ago (2011-04-19 17:53:38 UTC) #9
stuartmorgan
Rebased onto the revert. Please take a look at that part of the code and ...
9 years, 8 months ago (2011-04-19 20:10:10 UTC) #10
jar (doing other things)
LGTM To test, you should build with a change in browser_main.cc to ensure that metrics ...
9 years, 8 months ago (2011-04-19 22:37:39 UTC) #11
stuartmorgan
9 years, 8 months ago (2011-04-19 22:45:46 UTC) #12
On 2011/04/19 22:37:39, jar wrote:
> To test, you should build with a change in browser_main.cc to ensure that
> metrics in enabled (it is turned off by default in all dev builds).  Metrics
> will (as you probably recall from this CL) do a first upload in 60 seconds,
and
> you should see a lot of these paths exercised. 
> 
> To get to see the ongoing logic work, you can set the delay (temporarily)
lower
> in your build, and see that additional uploads take place as expected.

Yep, way ahead of you on all counts :)

Powered by Google App Engine
This is Rietveld 408576698