diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-08-25 20:35:22 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-09-08 06:57:35 +0300 |
commit | 0af62aae07ccbb3783030367ffe405f45687abb3 (patch) | |
tree | 30bc49fab49a58052775ac4a27265c48232be7f5 /src/node_perf.h | |
parent | 1e01f3f022ba3bb57acc0eb47699f5ebd4ed5ac1 (diff) |
src: make ELDHistogram a HandleWrap
This simplifies the implementation of ELDHistogram a bit,
and more generally allows us to have weak JS references
associated with `HandleWrap`s.
PR-URL: https://github.com/nodejs/node/pull/29317
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_perf.h')
-rw-r--r-- | src/node_perf.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/node_perf.h b/src/node_perf.h index 4c7585d65ff..e8441e3bb72 100644 --- a/src/node_perf.h +++ b/src/node_perf.h @@ -123,14 +123,12 @@ class GCPerformanceEntry : public PerformanceEntry { PerformanceGCKind gckind_; }; -class ELDHistogram : public BaseObject, public Histogram { +class ELDHistogram : public HandleWrap, public Histogram { public: ELDHistogram(Environment* env, Local<Object> wrap, int32_t resolution); - ~ELDHistogram() override; - bool RecordDelta(); bool Enable(); bool Disable(); @@ -149,13 +147,13 @@ class ELDHistogram : public BaseObject, public Histogram { SET_SELF_SIZE(ELDHistogram) private: - void CloseTimer(); + static void DelayIntervalCallback(uv_timer_t* req); bool enabled_ = false; int32_t resolution_ = 0; int64_t exceeds_ = 0; uint64_t prev_ = 0; - uv_timer_t* timer_; + uv_timer_t timer_; }; } // namespace performance |