From 23e2c98d247bf2104b928c9394ef5efb57dbb990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 8 Jun 2016 16:42:14 +0200 Subject: [PATCH 1/3] Emit lookupN timing event --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 4f36cd49..e842a9c7 100644 --- a/index.js +++ b/index.js @@ -514,8 +514,10 @@ RingPop.prototype.lookupN = function lookupN(key, n) { var dests = this.ring.lookupN(key + '', n); + var timing = Date.now() - startTime; + this.stat('timing', 'lookupN.+' + n, timing); this.emit('lookupN', { - timing: Date.now() - startTime + timing: timing }); if (!dests || dests.length === 0) { From bac667dddf73378c76fa22f68b83cd2630040cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 8 Jun 2016 16:51:49 +0200 Subject: [PATCH 2/3] Fix casing in the stat --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index e842a9c7..166ffc2a 100644 --- a/index.js +++ b/index.js @@ -515,7 +515,7 @@ RingPop.prototype.lookupN = function lookupN(key, n) { var dests = this.ring.lookupN(key + '', n); var timing = Date.now() - startTime; - this.stat('timing', 'lookupN.+' + n, timing); + this.stat('timing', 'lookupn.'+ + n, timing); this.emit('lookupN', { timing: timing }); From 6bf023966e5e1d498d0e5ba6d877ce6d53c395f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 8 Jun 2016 16:53:05 +0200 Subject: [PATCH 3/3] Fix typo in stat emission code --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 166ffc2a..12fa1bc7 100644 --- a/index.js +++ b/index.js @@ -515,7 +515,7 @@ RingPop.prototype.lookupN = function lookupN(key, n) { var dests = this.ring.lookupN(key + '', n); var timing = Date.now() - startTime; - this.stat('timing', 'lookupn.'+ + n, timing); + this.stat('timing', 'lookupn.' + n, timing); this.emit('lookupN', { timing: timing });