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

Issue 2361933002: Refactor histogram_macros.h. This improves documentation for the macros in the file, moves LOCAL_* … (Closed)

Created:
4 years, 3 months ago by rkaplow
Modified:
4 years, 2 months ago
CC:
chromium-reviews, asvitkine+watch_chromium.org, nikunjb1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor histogram_macros.h. This improves documentation for the macros in the file, moves LOCAL_* to a seperate file, and hides the internal macros that do not need to be exposed to histogram users into an internal file. This doesn't require any client changes as both files are includes in histogram_macros.h BUG=649410 Committed: https://crrev.com/a1ee205ef9f3dce6af516cf18a7b6426ebbd8d55 Cr-Commit-Position: refs/heads/master@{#421241}

Patch Set 1 #

Total comments: 64

Patch Set 2 : mark comments #

Patch Set 3 : extra fixes #

Total comments: 20

Patch Set 4 : asvitkine #

Total comments: 10

Patch Set 5 : asvitkine2 #

Patch Set 6 : reword #

Total comments: 8

Patch Set 7 : mpearson comments 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+423 lines, -269 lines) Patch
M base/metrics/histogram_base.h View 2 chunks +3 lines, -1 line 0 comments Download
M base/metrics/histogram_macros.h View 1 2 3 4 5 6 1 chunk +202 lines, -267 lines 0 comments Download
A base/metrics/histogram_macros_internal.h View 1 2 3 4 5 1 chunk +129 lines, -0 lines 0 comments Download
A base/metrics/histogram_macros_local.h View 1 2 3 1 chunk +88 lines, -0 lines 0 comments Download
M base/metrics/histogram_snapshot_manager.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 30 (10 generated)
Mark P
This is good work, a huge improvement! I have a bunch of comments, all pretty ...
4 years, 2 months ago (2016-09-23 19:30:43 UTC) #4
nikunjb1
https://codereview.chromium.org/2361933002/diff/1/base/metrics/histogram_macros.h File base/metrics/histogram_macros.h (left): https://codereview.chromium.org/2361933002/diff/1/base/metrics/histogram_macros.h#oldcode102 base/metrics/histogram_macros.h:102: #define STATIC_HISTOGRAM_POINTER_BLOCK(constant_histogram_name, \ I see usage of this outside ...
4 years, 2 months ago (2016-09-23 21:14:13 UTC) #6
Mark P
https://codereview.chromium.org/2361933002/diff/1/base/metrics/histogram_macros.h File base/metrics/histogram_macros.h (right): https://codereview.chromium.org/2361933002/diff/1/base/metrics/histogram_macros.h#newcode57 base/metrics/histogram_macros.h:57: #define UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ On 2016/09/23 ...
4 years, 2 months ago (2016-09-23 21:24:08 UTC) #7
rkaplow
thanks for review! Sorry it was a bit awkward to review with all the pieces ...
4 years, 2 months ago (2016-09-26 20:16:11 UTC) #8
Alexei Svitkine (slow)
Looks great overall, some comments below. :) https://codereview.chromium.org/2361933002/diff/40001/base/metrics/histogram_base.h File base/metrics/histogram_base.h (right): https://codereview.chromium.org/2361933002/diff/40001/base/metrics/histogram_base.h#newcode126 base/metrics/histogram_base.h:126: // be ...
4 years, 2 months ago (2016-09-26 20:35:48 UTC) #9
rkaplow
https://codereview.chromium.org/2361933002/diff/40001/base/metrics/histogram_macros.h File base/metrics/histogram_macros.h (right): https://codereview.chromium.org/2361933002/diff/40001/base/metrics/histogram_macros.h#newcode38 base/metrics/histogram_macros.h:38: // Sample Usage: On 2016/09/26 20:35:48, Alexei Svitkine (very ...
4 years, 2 months ago (2016-09-26 21:15:21 UTC) #10
Alexei Svitkine (slow)
LGTM with a few comments below. Please wait for your other two reviewers, though - ...
4 years, 2 months ago (2016-09-26 21:25:17 UTC) #11
rkaplow
https://codereview.chromium.org/2361933002/diff/60001/base/metrics/histogram_macros.h File base/metrics/histogram_macros.h (right): https://codereview.chromium.org/2361933002/diff/60001/base/metrics/histogram_macros.h#newcode36 base/metrics/histogram_macros.h:36: // UMA_HISTOGRAM_ENUMERATION("My.Enumeration", Enum::VALUE, Enum::EVENT_MAX); On 2016/09/26 21:25:17, Alexei Svitkine ...
4 years, 2 months ago (2016-09-26 21:37:48 UTC) #12
nikunjb1
lgtm
4 years, 2 months ago (2016-09-26 22:52:23 UTC) #13
Mark P
lgtm pending resolution of comments below https://codereview.chromium.org/2361933002/diff/1/base/metrics/histogram_base.h File base/metrics/histogram_base.h (right): https://codereview.chromium.org/2361933002/diff/1/base/metrics/histogram_base.h#newcode125 base/metrics/histogram_base.h:125: // TODO(rkaplow): Look ...
4 years, 2 months ago (2016-09-26 23:06:47 UTC) #14
rkaplow
https://codereview.chromium.org/2361933002/diff/100001/base/metrics/histogram_macros.h File base/metrics/histogram_macros.h (right): https://codereview.chromium.org/2361933002/diff/100001/base/metrics/histogram_macros.h#newcode107 base/metrics/histogram_macros.h:107: // buckets. On 2016/09/26 23:06:47, Mark P wrote: > ...
4 years, 2 months ago (2016-09-27 15:08:26 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2361933002/120001
4 years, 2 months ago (2016-09-27 15:12:11 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/76034)
4 years, 2 months ago (2016-09-27 15:41:59 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2361933002/120001
4 years, 2 months ago (2016-09-27 16:49:05 UTC) #22
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 2 months ago (2016-09-27 17:12:30 UTC) #24
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/a1ee205ef9f3dce6af516cf18a7b6426ebbd8d55 Cr-Commit-Position: refs/heads/master@{#421241}
4 years, 2 months ago (2016-09-27 17:15:46 UTC) #26
Mark P
https://codereview.chromium.org/2361933002/diff/1/base/metrics/histogram_macros.h File base/metrics/histogram_macros.h (left): https://codereview.chromium.org/2361933002/diff/1/base/metrics/histogram_macros.h#oldcode102 base/metrics/histogram_macros.h:102: #define STATIC_HISTOGRAM_POINTER_BLOCK(constant_histogram_name, \ On 2016/09/26 23:06:47, Mark P wrote: ...
4 years, 2 months ago (2016-09-29 23:15:00 UTC) #27
rkaplow
On 2016/09/29 23:15:00, Mark P wrote: > https://codereview.chromium.org/2361933002/diff/1/base/metrics/histogram_macros.h > File base/metrics/histogram_macros.h (left): > > https://codereview.chromium.org/2361933002/diff/1/base/metrics/histogram_macros.h#oldcode102 ...
4 years, 2 months ago (2016-09-30 15:27:20 UTC) #28
Mark P
On Fri, Sep 30, 2016 at 8:27 AM, <rkaplow@chromium.org> wrote: > On 2016/09/29 23:15:00, Mark ...
4 years, 2 months ago (2016-09-30 15:57:47 UTC) #29
rkaplow
4 years, 2 months ago (2016-09-30 21:32:45 UTC) #30
Message was sent while issue was closed.
On 2016/09/30 15:57:47, Mark P wrote:
> On Fri, Sep 30, 2016 at 8:27 AM, <mailto:rkaplow@chromium.org> wrote:
> 
> > On 2016/09/29 23:15:00, Mark P wrote:
> > >
> > https://codereview.chromium.org/2361933002/diff/1/base/
> > metrics/histogram_macros.h
> > > File base/metrics/histogram_macros.h (left):
> > >
> > >
> > https://codereview.chromium.org/2361933002/diff/1/base/
> > metrics/histogram_macros.h#oldcode102
> > > base/metrics/histogram_macros.h:102: #define
> > > STATIC_HISTOGRAM_POINTER_BLOCK(constant_histogram_name, \
> > > On 2016/09/26 23:06:47, Mark P wrote:
> > > > On 2016/09/26 20:16:10, rkaplow wrote:
> > > > > On 2016/09/23 21:14:12, nikunjb1 wrote:
> > > > > > I see usage of this outside histogram_macros.h e.g
> > > > > > //src/components/metrics/system_memory_stats_recorder_linux.cc
> > > > > >
> > > > > > and
> > > > > > src/chromecast/base/metrics/cast_histograms.h
> > > > > >
> > > > > > Since this is only moved it won't have compilation issues, but is
> > it
> > okay
> > > > keep
> > > > > > them using internal implementations?
> > > > >
> > > > > Probably not ideal - we'd need to see why they were doing this.
> > > > >
> > > > > For example
> > > > >
> > > >
> > >
> > https://codesearch.chromium.org/chromium/src/components/
> > metrics/system_memory_stats_recorder_linux.cc?q=STATIC_
> > HISTOGRAM_POINTER_BLOCK&sq=package:chromium&dr=C&l=19
> > > > > - not sure this was needed.
> > > > >
> > > > > One thing we don't make easy to do is a numeric linear histogram. I
> > wonder
> > > if
> > > > we
> > > > > should add that for cases where people might want it.
> > > > >
> > > > > I'd rather not do in this CL but we could - what do you guys think?
> > > >
> > > > Generally I've been advising people to use ENUMERATION when they want
> > linear
> > > > histograms. (It's only a small encouragement; I don't feel strongly.)
> > It's
> > > > hard to screw up the bucketing if you change things later.
> > > >
> > > > Maybe we should simply add a LINEAR macro instead?
> > >
> > > What do you think about this suggestion?
> >
> > I'm not against it, but I'm not sure how commonly it would be used - and
> > when we
> > should be recommending linear over exponential.
> >
> > One example is allowing stuff like percentiles with courser detailing -
> > with
> > bucket of 5% or something like that.
> > Anyway, seems reasonable to add. I can do it.
> >
> 
> I agree that I don't think we should be recommending it, but I think we
> should be providing a macros that supports it.  It always feels weird to be
> and code writers when I tell people to use the ENUMERATION macro without an
> enum simply because they want a linear histogram...
> 
> Thanks preemptively for adding it.
> 
> I think a linear bucket-size one will suffice (basically an alias for
> enumerated histograms); I haven't seen as much need to support other bucket
> sizes.

Hey Mark - I was looking into supporting the general use case for linear
histograms, since there are a few places where it is used, often for measuring
up to a fixed max (like a percentage), but with less granularity. However there
are some issues with the suggested parameters which has lead to some incorrect
linear histograms. I wrote up some of my thoughts on it here.
https://bugs.chromium.org/p/chromium/issues/detail?id=651950

I can still just add a macro for the size-1 version which is still the most
common, for now.


> 
> --mark
> 
> 
> >
> > https://codereview.chromium.org/2361933002/
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups
> "Chromium-reviews" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email
> to mailto:chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698