Medida
exp_decay_sample.h
00001 //
00002 // Copyright (c) 2012 Daniel Lundin
00003 //
00004 
00005 #ifndef MEDIDA_EXP_DECAY_SAMPLE_H_
00006 #define MEDIDA_EXP_DECAY_SAMPLE_H_
00007 
00008 #include <cstdint>
00009 #include <memory>
00010 
00011 #include "medida/types.h"
00012 #include "medida/stats/sample.h"
00013 
00014 namespace medida {
00015 namespace stats {
00016 
00017 class ExpDecaySample : public Sample {
00018  public:
00019   ExpDecaySample() = delete;
00020   ExpDecaySample(std::uint32_t reservoirSize, double alpha);
00021   ~ExpDecaySample();
00022   virtual void Clear();
00023   virtual std::uint64_t size() const;
00024   virtual void Update(std::int64_t value);
00025   virtual void Update(std::int64_t value, Clock::time_point timestamp);
00026   virtual Snapshot MakeSnapshot() const;
00027  private:
00028   class Impl;
00029   std::unique_ptr<Impl> impl_;
00030 };
00031 
00032 } // namespace stats
00033 } // namespace medida
00034 
00035 #endif // MEDIDA_EXP_DECAY_SAMPLE_H_
 All Classes