Commit 959f5a40 authored by Kevin Modzelewski's avatar Kevin Modzelewski Committed by Kevin Modzelewski

clean up stats a tad

parent 93b5d65d
...@@ -38,7 +38,6 @@ extern "C" const char* getStatTimerName() { ...@@ -38,7 +38,6 @@ extern "C" const char* getStatTimerName() {
__thread StatTimer* StatTimer::stack; __thread StatTimer* StatTimer::stack;
StatTimer::StatTimer(int statid, bool push) { StatTimer::StatTimer(int statid, bool push) {
uint64_t at_time = getCPUTicks(); uint64_t at_time = getCPUTicks();
_duration = 0;
_start_time = 0; _start_time = 0;
_statid = statid; _statid = statid;
...@@ -56,7 +55,6 @@ StatTimer::StatTimer(int statid, bool push) { ...@@ -56,7 +55,6 @@ StatTimer::StatTimer(int statid, bool push) {
} }
StatTimer::StatTimer(int statid, uint64_t at_time) { StatTimer::StatTimer(int statid, uint64_t at_time) {
_duration = 0;
_start_time = 0; _start_time = 0;
_statid = statid; _statid = statid;
_prev = stack; _prev = stack;
...@@ -88,13 +86,10 @@ StatTimer::~StatTimer() { ...@@ -88,13 +86,10 @@ StatTimer::~StatTimer() {
void StatTimer::pause(uint64_t at_time) { void StatTimer::pause(uint64_t at_time) {
assert(!isPaused()); assert(!isPaused());
assert(at_time > _start_time); assert(at_time > _start_time);
auto cur_duration = _duration;
_duration = at_time - _start_time;
assert(_duration > cur_duration);
uint64_t _duration = at_time - _start_time;
Stats::log(_statid, _duration); Stats::log(_statid, _duration);
_duration = 0;
_start_time = 0; _start_time = 0;
_last_pause_time = at_time; _last_pause_time = at_time;
// fprintf (stderr, "paused %d at %lu\n", _statid, at_time); // fprintf (stderr, "paused %d at %lu\n", _statid, at_time);
......
...@@ -116,9 +116,6 @@ class StatTimer { ...@@ -116,9 +116,6 @@ class StatTimer {
private: private:
static __thread StatTimer* stack; static __thread StatTimer* stack;
// the accumulated active duration of this timer
uint64_t _duration;
// the start time of the current active segment (0 == paused) // the start time of the current active segment (0 == paused)
uint64_t _start_time; uint64_t _start_time;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment