From 809ca4ad84f796eeb1c8a4fdbeca3494f96960c8 Mon Sep 17 00:00:00 2001 From: LowPowerLab Date: Wed, 2 Nov 2016 15:37:19 -0400 Subject: [PATCH] Fix v8.8 logUtil.js --- logUtil.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/logUtil.js b/logUtil.js index 60e7af6..ba0f236 100644 --- a/logUtil.js +++ b/logUtil.js @@ -57,7 +57,13 @@ exports.getData = function(filename, start, end, dpcount) { value = buff.readInt32BE(5); data.push({t:timetmp*1000, v:value/10000}); } - return {data:data, queryTime:(new Date() - ts), totalIntervalDatapoints: (posEnd-posStart)/9+1 }; + return { + data:data, + queryTime:(new Date() - ts), + totalIntervalDatapoints: (posEnd-posStart)/9+1, + totalDatapoints:filesize/9, + logSize:filesize + }; } //too many data points, use binarySearch to aggregate @@ -77,7 +83,13 @@ exports.getData = function(filename, start, end, dpcount) { } fs.closeSync(fd); - return {data:data, queryTime:(new Date() - ts), totalIntervalDatapoints: (posEnd-posStart)/9+1 }; + return { + data:data, + queryTime:(new Date() - ts), + totalIntervalDatapoints: (posEnd-posStart)/9+1, + totalDatapoints:filesize/9, + logSize:filesize + }; } // filename: binary file to append new data point to