update TimeseriesHistogram::rate to return a template type
authorAdam Simpkins <simpkins@fb.com>
Wed, 31 Aug 2016 19:21:13 +0000 (12:21 -0700)
committerFacebook Github Bot 4 <facebook-github-bot-4-bot@fb.com>
Wed, 31 Aug 2016 19:23:29 +0000 (12:23 -0700)
commitbd8228d9514fb717cb495b28de9974b447f08a45
tree6d7cd9d8df70f32ee588d856fc1e454b2b429ec4
parent9d7ab80969fcc76e95103568daa249d00cd14790
update TimeseriesHistogram::rate to return a template type

Summary:
Update TimeseriesHistogram::rate(int level) to have a configurable return type,
similar to the rate(TimeType start, TimeType end) function, as well as the
avg() functions.  I believe it was simply an oversight initially that this
version of rate did not have a configurable return type.

Since rate() and avg() are template methods, their full definitions should
really be available in TimeseriesHistogram.h rather than
TimeseriesHistogram-defs.h.  This also fixes that problem.  Most of the logic
in these functions isn't actually dependent on the return type, so that was
split out into separate non-template helper functions that are still in
TimeseriesHistogram-defs.h

Reviewed By: yfeldblum

Differential Revision: D3776017

fbshipit-source-id: 7deebf5b9ea1be143b5d772a15246706cb0cae80
folly/stats/TimeseriesHistogram-defs.h
folly/stats/TimeseriesHistogram.h
folly/test/TimeseriesHistogramTest.cpp