diff --git a/app.js b/app.js index c23c744..38d48e9 100644 --- a/app.js +++ b/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'); diff --git a/models/node.js b/models/node.js index e327f7f..114a312 100644 --- a/models/node.js +++ b/models/node.js @@ -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; }