added latency on connection
This commit is contained in:
parent
6c17d0ee9c
commit
d4a2cba41f
1
app.js
1
app.js
@ -46,6 +46,7 @@ api.on('connection', function(spark) {
|
||||
{
|
||||
data.ip = spark.address.ip;
|
||||
data.spark = spark.id;
|
||||
data.latency = spark.latency;
|
||||
|
||||
var info = Nodes.add(data);
|
||||
spark.emit('ready');
|
||||
|
@ -40,6 +40,9 @@ var Node = function Node(data)
|
||||
if(typeof data.spark !== 'undefined')
|
||||
this.spark = data.spark;
|
||||
|
||||
if(typeof data.latency !== 'undefined')
|
||||
this.stats.latency = data.latency;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user