From 669df123648aaa6aeccc70206b5417bc48b4e9ae Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:26:50 +0200 Subject: 5.19 --- lib/perf_check.h | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'lib/perf_check.h') diff --git a/lib/perf_check.h b/lib/perf_check.h index 3e04b778..9d82be57 100644 --- a/lib/perf_check.h +++ b/lib/perf_check.h @@ -9,31 +9,37 @@ #include #include +#include class PerfCheck { public: - PerfCheck(unsigned int windowSizeRemainingTime, //unit: [ms] - unsigned int windowSizeBytesPerSecond); // + PerfCheck(unsigned int windowSizeRemainingTime, //unit: [ms] + unsigned int windowSizeSpeed); // ~PerfCheck(); - void addSample(int objectsCurrent, double dataCurrent, long timeMs); //timeMs must be ascending! + void addSample(int itemsCurrent, double dataCurrent, long timeMs); //timeMs must be ascending! - std::wstring getRemainingTime(double dataRemaining) const; - std::wstring getBytesPerSecond() const; //for window + zen::Opt getRemainingTime(double dataRemaining) const; + zen::Opt getBytesPerSecond() const; //for window + zen::Opt getItemsPerSecond() const; //for window private: - const long windowSizeRemTime; //unit: [ms] - const long windowSizeBPS; // - const long windowMax; - struct Record { - Record(int objCount, double data) : objCount_(objCount), data_(data) {} - int objCount_; + Record(int itemCount, double data) : itemCount_(itemCount), data_(data) {} + int itemCount_; double data_; //unit: [bytes] }; - std::multimap samples; //time, unit: [ms] + + std::pair::value_type*, + const std::multimap::value_type*> getBlockFromEnd(long windowSize) const; + + const long windowSizeRemTime; //unit: [ms] + const long windowSizeSpeed_; // + const long windowMax; + + std::map samples; //time, unit: [ms] }; #endif // STATISTICS_H_INCLUDED -- cgit