Skip to content

Commit

Permalink
Stat number of retries performed during join process
Browse files Browse the repository at this point in the history
  • Loading branch information
jwolski committed Oct 23, 2015
1 parent c3a9154 commit ba75d50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/gossip/joiner.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ Joiner.prototype.join = function join(callback) {
var startTime = Date.now();
var calledBack = false;

this.joinGroup(nodesJoined, onJoin);

function onJoin(err, nodes) {
if (calledBack) {
return;
Expand Down Expand Up @@ -229,6 +231,7 @@ Joiner.prototype.join = function join(callback) {
// No need to keep this data hanging around.
self.joinResponses = null;

self.ringpop.stat('gauge', 'join.retries', self.joinRetries);
self.ringpop.stat('timing', 'join', joinTime);
self.ringpop.stat('increment', 'join.complete');
self.ringpop.logger.debug('ringpop join complete', {
Expand All @@ -246,6 +249,7 @@ Joiner.prototype.join = function join(callback) {
var joinDuration = Date.now() - startTime;
var maxJoinDuration = self.ringpop.config.get('maxJoinDuration');
if (joinDuration > maxJoinDuration) {
self.ringpop.stat('gauge', 'join.retries', self.joinRetries);
self.ringpop.logger.warn('ringpop max join duration exceeded', {
local: self.ringpop.whoami(),
joinDuration: joinDuration,
Expand Down Expand Up @@ -314,8 +318,6 @@ Joiner.prototype.join = function join(callback) {
}, self.joinDelay);
}
}

this.joinGroup(nodesJoined, onJoin);
};

Joiner.prototype.joinGroup = function joinGroup(totalNodesJoined, callback) {
Expand Down

0 comments on commit ba75d50

Please sign in to comment.