summaryrefslogtreecommitdiff
path: root/library/statistics.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:09:45 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:09:45 +0200
commit88c8801298cbf6fec9cdce254c7b3cb9e066a421 (patch)
tree35a35acf48eb227bac30abc8f87ea9b1c3c57b68 /library/statistics.h
parent3.12 (diff)
downloadFreeFileSync-88c8801298cbf6fec9cdce254c7b3cb9e066a421.tar.gz
FreeFileSync-88c8801298cbf6fec9cdce254c7b3cb9e066a421.tar.bz2
FreeFileSync-88c8801298cbf6fec9cdce254c7b3cb9e066a421.zip
3.13
Diffstat (limited to 'library/statistics.h')
-rw-r--r--library/statistics.h29
1 files changed, 15 insertions, 14 deletions
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 <vector>
-#include <list>
+#include <map>
#include <memory>
#include <wx/defs.h>
@@ -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<statEntry> data;
+ std::vector<StatEntry> data;
std::auto_ptr<wxStopWatch> 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<record> measurements;
+ typedef std::multimap<long, Record> TimeRecordMap; //time, unit: milliseconds
+ TimeRecordMap measurements; //
+
wxStopWatch* timer;
};
bgstack15