added latency update
This commit is contained in:
@@ -26,6 +26,16 @@ Collection.prototype.update = function(id, stats)
|
||||
return node.setStats(stats);
|
||||
}
|
||||
|
||||
Collection.prototype.updateLatency = function(id, latency)
|
||||
{
|
||||
var node = this.getNode({ id: id });
|
||||
|
||||
if(!node)
|
||||
return false;
|
||||
|
||||
return node.setLatency(latency);
|
||||
}
|
||||
|
||||
Collection.prototype.inactive = function(id)
|
||||
{
|
||||
var node = this.getNode({ spark: id });
|
||||
|
||||
@@ -104,6 +104,18 @@ Node.prototype.setStats = function(stats)
|
||||
return false;
|
||||
}
|
||||
|
||||
Node.prototype.setLatency = function(latency)
|
||||
{
|
||||
if(typeof latency !== 'undefined')
|
||||
{
|
||||
this.stats.latency = latency;
|
||||
|
||||
return { id: this.id, latency: latency };
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Node.prototype.getStats = function()
|
||||
{
|
||||
return {id: this.id, stats: this.stats};
|
||||
|
||||
Reference in New Issue
Block a user