mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:17:43 +02:00
fix for warnings produced by CounterStats refactor
This commit is contained in:
parent
cc2f35ca89
commit
1415a25302
2 changed files with 32 additions and 17 deletions
|
@ -33,6 +33,33 @@
|
||||||
// int sampleAt;
|
// int sampleAt;
|
||||||
|
|
||||||
|
|
||||||
|
CounterStatHistory::CounterStatHistory() {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
CounterStatHistory::CounterStatHistory(std::string myName) {
|
||||||
|
init();
|
||||||
|
name = myName;
|
||||||
|
}
|
||||||
|
|
||||||
|
CounterStatHistory::CounterStatHistory(std::string myName, double initialTime, long initialCount) {
|
||||||
|
init();
|
||||||
|
lastCount = currentCount = initialCount;
|
||||||
|
lastTime = currentTime = totalTime = initialTime;
|
||||||
|
name = myName;
|
||||||
|
}
|
||||||
|
|
||||||
|
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