Skip to content

Commit

Permalink
Merge pull request bitcoin#792 from ptschip/dev_stat
Browse files Browse the repository at this point in the history
Fix thinstats
  • Loading branch information
gandrewstone committed Oct 13, 2017
2 parents 2959a04 + 51e5530 commit 54a64ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/stat.h
Expand Up @@ -187,7 +187,7 @@ class CStatHistory : public CStat<DataType, RecordType>
public:
CStatHistory() : CStat<DataType, RecordType>(), 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<DataType, RecordType>(name), op(operation), timer(stat_io_service)
Expand Down Expand Up @@ -215,7 +215,7 @@ class CStatHistory : public CStat<DataType, RecordType>
Clear();
}

void Clear(void)
void Clear(bool fStart = true)
{
timerCount = 0;
sampleCount = 0;
Expand All @@ -230,7 +230,9 @@ class CStatHistory : public CStat<DataType, RecordType>
}
total = RecordType();
this->value = RecordType();
Start();

if (fStart)
Start();
}

virtual ~CStatHistory() {}
Expand Down

0 comments on commit 54a64ad

Please sign in to comment.