diff --git a/lib/data/metric.js b/lib/data/metric.js index 65e2d08..74022bb 100644 --- a/lib/data/metric.js +++ b/lib/data/metric.js @@ -54,20 +54,20 @@ Metric.prototype.dataAsRoot = function (value) { }; Metric.prototype.dataAsArray = function (msg) { - var l = msg.data.length; + var l = msg.length; this.globalCid = msg.cid || this.componentId ; for (var i = 0; i < l; i++) { - var value = msg.data[i]; + var value = msg[i]; this.dataAsRoot(value); } }; -Metric.prototype.dataProcess = function (datoArr) { - if (datoArr) { - if (Array.isArray(datoArr.data)) { - this.dataAsArray(datoArr); +Metric.prototype.dataProcess = function (dataArr) { + if (dataArr) { + if (Array.isArray(dataArr)) { + this.dataAsArray(dataArr); } else { - this.dataAsRoot(datoArr); + this.dataAsRoot(dataArr); } } }; diff --git a/package.json b/package.json index c482464..3e600fc 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "dependencies": { "async": "^3.1.0", "borc": "^2.1.1", - "mqtt" : "^3.0.0", + "mqtt": "^3.0.0", "request": "^2.88.0", "tunnel": "0.0.6", "websocket": "^1.0.29"