summaryrefslogtreecommitdiff
path: root/src/node_perf.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-08-25 19:35:22 +0200
committerRich Trott <rtrott@gmail.com>2019-09-07 20:57:35 -0700
commit0af62aae07ccbb3783030367ffe405f45687abb3 (patch)
tree30bc49fab49a58052775ac4a27265c48232be7f5 /src/node_perf.h
parent1e01f3f022ba3bb57acc0eb47699f5ebd4ed5ac1 (diff)
downloadandroid-node-v8-0af62aae07ccbb3783030367ffe405f45687abb3.tar.gz
android-node-v8-0af62aae07ccbb3783030367ffe405f45687abb3.tar.bz2
android-node-v8-0af62aae07ccbb3783030367ffe405f45687abb3.zip
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.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/node_perf.h b/src/node_perf.h
index 4c7585d65f..e8441e3bb7 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