Add constructor for MultiLevelTimeSeries class that uses initializer_list and add...
authorCaren Thomas <carenthomas@fb.com>
Wed, 15 Jun 2016 00:52:36 +0000 (17:52 -0700)
committerFacebook Github Bot 1 <facebook-github-bot-1-bot@fb.com>
Wed, 15 Jun 2016 00:53:43 +0000 (17:53 -0700)
commitbd6447c62a08f3025649803c570250a50c5065c4
treecbc2a6b2d08b317afa2a9607c336b8c18f62246f
parent55c9d0bdae2f6f77233b3f95809c781e470eccd6
Add constructor for MultiLevelTimeSeries class that uses initializer_list and add stat methods that uses duration as a parameter.

Summary: Introduce a constructor that takes in an initializer list of 'TimeType' objects for the durations. New methods for sum/avg/rate/count/countrate are created with a 'TimeType' parameter - this makes it possible to call these methods using the duration that specifies the level. Previously, these methods could only be called using the index of the level in the levels_ vector. These methods first do a linear scan through levels_ using the method getLevelsByDuration to find the corresponding index, and then perform the function they specify on the level.

Differential Revision: D3414343

fbshipit-source-id: 8e1fcc16fd013d0b8b855a1eebbeff417e945b07
folly/stats/MultiLevelTimeSeries-defs.h
folly/stats/MultiLevelTimeSeries.h
folly/test/TimeseriesTest.cpp