From 88c8801298cbf6fec9cdce254c7b3cb9e066a421 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:09:45 +0200 Subject: 3.13 --- library/statistics.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'library/statistics.h') diff --git a/library/statistics.h b/library/statistics.h index 26e8c196..a9692d77 100644 --- a/library/statistics.h +++ b/library/statistics.h @@ -1,14 +1,14 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef STATISTICS_H_INCLUDED #define STATISTICS_H_INCLUDED #include -#include +#include #include #include @@ -27,14 +27,14 @@ public: void writeEntry(const double value, const int objects); private: - struct statEntry + struct StatEntry { long time; int objects; double value; }; - std::vector data; + std::vector data; std::auto_ptr timer; }; @@ -42,14 +42,14 @@ private: class Statistics { public: - Statistics(const int totalObjectCount, - const double totalDataAmount, - const unsigned windowSizeRemainingTime, //time in ms - const unsigned windowSizeBytesPerSecond); //time in ms + Statistics(int totalObjectCount, + double totalDataAmount, + unsigned windowSizeRemainingTime, //time in ms + unsigned windowSizeBytesPerSecond); //time in ms ~Statistics(); - void addMeasurement(const int objectsCurrent, const double dataCurrent); + void addMeasurement(int objectsCurrent, double dataCurrent); wxString getRemainingTime() const; //returns the remaining time in milliseconds wxString getBytesPerSecond() const; @@ -57,7 +57,7 @@ public: void resumeTimer(); private: - wxString formatRemainingTime(const double timeInMs) const; + wxString formatRemainingTime(double timeInMs) const; const int objectsTotal; const double dataTotal; @@ -68,14 +68,15 @@ private: mutable int remainingTimeLast; //used for "smoothening" remaining time - struct record + struct Record { - int objects; + int objects; //object count double data; //unit: bytes - long time; //unit: milliseconds }; - std::list measurements; + typedef std::multimap TimeRecordMap; //time, unit: milliseconds + TimeRecordMap measurements; // + wxStopWatch* timer; }; -- cgit