proxygen
BucketedTimeSeriesBenchmark.cpp File Reference
#include <folly/stats/BucketedTimeSeries.h>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/stats/BucketedTimeSeries-defs.h>

Go to the source code of this file.

Functions

void addValue (unsigned int iters, seconds duration, size_t numBuckets, size_t callsPerSecond)
 
 BENCHMARK_DRAW_LINE ()
 
int main (int argc, char *argv[])
 

Function Documentation

void addValue ( unsigned int  iters,
seconds  duration,
size_t  numBuckets,
size_t  callsPerSecond 
)

Definition at line 28 of file BucketedTimeSeriesBenchmark.cpp.

References folly::BucketedTimeSeries< VT, CT >::addValue(), BENCHMARK_DRAW_LINE(), BENCHMARK_NAMED_PARAM, and folly::BenchmarkSuspender::dismiss().

32  {
33  BenchmarkSuspender suspend;
34  BucketedTimeSeries<int64_t> ts(numBuckets, duration);
35  suspend.dismiss();
36 
37  seconds currentTime(1342000000);
38  size_t timeCounter = 0;
39  for (unsigned int n = 0; n < iters; ++n, ++timeCounter) {
40  if (timeCounter >= callsPerSecond) {
41  timeCounter = 0;
42  ++currentTime;
43  }
44  ts.addValue(currentTime, n);
45  }
46 }
BENCHMARK_DRAW_LINE ( )

Referenced by addValue().

int main ( int  argc,
char *  argv[] 
)

Definition at line 76 of file BucketedTimeSeriesBenchmark.cpp.

References argv, and folly::runBenchmarks().

76  {
77  gflags::ParseCommandLineFlags(&argc, &argv, true);
79  return 0;
80 }
void runBenchmarks()
Definition: Benchmark.cpp:456
char ** argv