Skip to content

Commit 809ca4a

Browse files
committed
Fix v8.8 logUtil.js
1 parent f0863d8 commit 809ca4a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

logUtil.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ exports.getData = function(filename, start, end, dpcount) {
5757
value = buff.readInt32BE(5);
5858
data.push({t:timetmp*1000, v:value/10000});
5959
}
60-
return {data:data, queryTime:(new Date() - ts), totalIntervalDatapoints: (posEnd-posStart)/9+1 };
60+
return {
61+
data:data,
62+
queryTime:(new Date() - ts),
63+
totalIntervalDatapoints: (posEnd-posStart)/9+1,
64+
totalDatapoints:filesize/9,
65+
logSize:filesize
66+
};
6167
}
6268

6369
//too many data points, use binarySearch to aggregate
@@ -77,7 +83,13 @@ exports.getData = function(filename, start, end, dpcount) {
7783
}
7884
fs.closeSync(fd);
7985

80-
return {data:data, queryTime:(new Date() - ts), totalIntervalDatapoints: (posEnd-posStart)/9+1 };
86+
return {
87+
data:data,
88+
queryTime:(new Date() - ts),
89+
totalIntervalDatapoints: (posEnd-posStart)/9+1,
90+
totalDatapoints:filesize/9,
91+
logSize:filesize
92+
};
8193
}
8294

8395
// filename: binary file to append new data point to

0 commit comments

Comments
 (0)