mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 15:59:49 +02:00
Merge pull request #40 from birarda/reorganize
fix for warnings produced by CounterStats refactor
This commit is contained in:
commit
f1e2a6688c
2 changed files with 52 additions and 17 deletions
|
@ -33,6 +33,53 @@
|
||||||
// int sampleAt;
|
// int sampleAt;
|
||||||
|
|
||||||
|
|
||||||
|
CounterStatHistory::CounterStatHistory() :
|
||||||
|
currentCount(0),
|
||||||
|
currentDelta(0),
|
||||||
|
currentTime(0.0),
|
||||||
|
lastCount(0),
|
||||||
|
lastTime(0.0),
|
||||||
|
totalTime(0.0),
|
||||||
|
sampleAt(-1),
|
||||||
|
sampleCount(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
CounterStatHistory::CounterStatHistory(std::string myName) :
|
||||||
|
name(myName),
|
||||||
|
currentCount(0),
|
||||||
|
currentDelta(0),
|
||||||
|
currentTime(0.0),
|
||||||
|
lastCount(0),
|
||||||
|
lastTime(0.0),
|
||||||
|
totalTime(0.0),
|
||||||
|
sampleAt(-1),
|
||||||
|
sampleCount(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CounterStatHistory::CounterStatHistory(std::string myName, double initialTime, long initialCount) :
|
||||||
|
name(myName),
|
||||||
|
currentCount(initialCount),
|
||||||
|
currentDelta(0),
|
||||||
|
currentTime(initialTime),
|
||||||
|
lastCount(initialCount),
|
||||||
|
lastTime(initialTime),
|
||||||
|
totalTime(initialTime),
|
||||||
|
sampleAt(-1),
|
||||||
|
sampleCount(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void CounterStatHistory::init() {
|
||||||
|
currentCount = 0;
|
||||||
|
currentDelta = 0;
|
||||||
|
currentTime = 0.0;
|
||||||
|
lastCount = 0;
|
||||||
|
lastTime = 0.0;
|
||||||
|
totalTime = 0.0;
|
||||||
|
sampleAt = -1;
|
||||||
|
sampleCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void CounterStatHistory::recordSample(long thisCount) {
|
void CounterStatHistory::recordSample(long thisCount) {
|
||||||
timeval now;
|
timeval now;
|
||||||
gettimeofday(&now,NULL);
|
gettimeofday(&now,NULL);
|
||||||
|
|
|
@ -25,23 +25,9 @@ class CounterStatHistory {
|
||||||
public:
|
public:
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
CounterStatHistory(std::string myName):
|
CounterStatHistory();
|
||||||
currentCount(0), currentDelta(0),currentTime(0.0),
|
CounterStatHistory(std::string myName);
|
||||||
lastCount(0),lastTime(0.0),
|
CounterStatHistory(std::string myName, double initialTime, long initialCount);
|
||||||
totalTime(0.0),
|
|
||||||
sampleAt(-1), sampleCount(0), name(myName) {};
|
|
||||||
|
|
||||||
CounterStatHistory():
|
|
||||||
currentCount(0), currentDelta(0),currentTime(0.0),
|
|
||||||
lastCount(0),lastTime(0.0),
|
|
||||||
totalTime(0.0),
|
|
||||||
sampleAt(-1), sampleCount(0) {};
|
|
||||||
|
|
||||||
CounterStatHistory(std::string myName, double initialTime, long initialCount) :
|
|
||||||
currentCount(initialCount), currentDelta(0), currentTime(initialTime),
|
|
||||||
lastCount(initialCount),lastTime(initialTime),
|
|
||||||
totalTime(initialTime),
|
|
||||||
sampleAt(-1), sampleCount(0), name(myName) {};
|
|
||||||
|
|
||||||
void recordSample(long thisCount);
|
void recordSample(long thisCount);
|
||||||
void recordSample(double thisTime, long thisCount);
|
void recordSample(double thisTime, long thisCount);
|
||||||
|
@ -58,6 +44,8 @@ public:
|
||||||
return currentCount;
|
return currentCount;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
|
void init();
|
||||||
|
|
||||||
long currentCount;
|
long currentCount;
|
||||||
long currentDelta;
|
long currentDelta;
|
||||||
double currentTime;
|
double currentTime;
|
||||||
|
|
Loading…
Reference in a new issue