Skip to content

Commit

Permalink
Add checksum to ring stats
Browse files Browse the repository at this point in the history
  • Loading branch information
jwolski committed Sep 10, 2015
1 parent 19fa0d0 commit 44a8fcd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ RingPop.prototype.getStats = function getStats() {
serverRate: this.serverRate.printObj().m1,
totalRate: this.totalRate.printObj().m1
},
ring: Object.keys(this.ring.servers),
ring: this.ring.getStats(),
version: this.ringpopVersion,
timestamp: timestamp,
uptime: uptime
Expand Down
7 changes: 7 additions & 0 deletions lib/ring.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ HashRing.prototype.getServerCount = function getServerCount() {
return Object.keys(this.servers).length;
};

HashRing.prototype.getStats = function getStats() {
return {
checksum: this.checksum,
servers: Object.keys(this.servers)
};
};

HashRing.prototype.hasServer = function hasServer(name) {
return !!this.servers[name];
};
Expand Down

0 comments on commit 44a8fcd

Please sign in to comment.