diff --git a/src/stat.h b/src/stat.h index c9b11b9ca5c81..bd84dd043e87f 100644 --- a/src/stat.h +++ b/src/stat.h @@ -187,7 +187,7 @@ class CStatHistory : public CStat public: CStatHistory() : CStat(), op(STAT_OP_SUM | STAT_KEEP_COUNT), timer(stat_io_service) { - Clear(); + Clear(false); } CStatHistory(const char *name, unsigned int operation = STAT_OP_SUM) : CStat(name), op(operation), timer(stat_io_service) @@ -215,7 +215,7 @@ class CStatHistory : public CStat Clear(); } - void Clear(void) + void Clear(bool fStart = true) { timerCount = 0; sampleCount = 0; @@ -230,7 +230,9 @@ class CStatHistory : public CStat } total = RecordType(); this->value = RecordType(); - Start(); + + if (fStart) + Start(); } virtual ~CStatHistory() {}