Skip to content
Permalink
Browse files

perf_hooks: reset prev_ before starting ELD timer

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 ZYSzys committed Mar 15, 2019
1 parent 78162ad commit 614a7474ab4896579cd77ce198fe00e4ca51917f
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/node_perf.cc
@@ -539,6 +539,7 @@ bool ELDHistogram::RecordDelta() {
bool ELDHistogram::Enable() {
if (enabled_) return false;
enabled_ = true;
prev_ = 0;
uv_timer_start(timer_,
ELDHistogramDelayInterval,
resolution_,

0 comments on commit 614a747

Please sign in to comment.
You can’t perform that action at this time.