Skip to content

Commit

Permalink
Fix v8.8 logUtil.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LowPowerLab committed Nov 2, 2016
1 parent f0863d8 commit 809ca4a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions logUtil.js
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 809ca4a

Please sign in to comment.