Skip to content

Commit

Permalink
perf_hooks: reset prev_ before starting ELD timer
Browse files Browse the repository at this point in the history
reset `ELDHistogram.prev_` before staring timer to ensure that start
timer doesn't leak across `disable()` `enable()` calls.

PR-URL: #26693
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
  • Loading branch information
Flarna authored and targos committed Mar 27, 2019
1 parent 8de9fe9 commit 0bd82c9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/node_perf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ bool ELDHistogram::RecordDelta() {
bool ELDHistogram::Enable() {
if (enabled_) return false;
enabled_ = true;
prev_ = 0;
uv_timer_start(timer_,
ELDHistogramDelayInterval,
resolution_,
Expand Down

0 comments on commit 0bd82c9

Please sign in to comment.