added latency on connection

This commit is contained in:
cubedro 2015-02-23 16:20:05 +02:00
parent 6c17d0ee9c
commit d4a2cba41f
2 changed files with 4 additions and 0 deletions

1
app.js
View File

@ -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');

View File

@ -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;
}