Skip to content

Commit f35ec08

Browse files
committed
Fixed uptime
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent 75e7351 commit f35ec08

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/cube.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Cube {
1111
this.batchSize = options.batchSize || 60
1212
this.dispatchInterval = options.dispatchInterval || 60
1313
this.tags = options.tags
14+
this.startTime = Date.now()
1415
this.uptime = 0
1516
this.cpu = 0.0
1617
this.memory = 0
@@ -25,7 +26,7 @@ class Cube {
2526
// System daemon
2627
setInterval(() => {
2728
pusage.stat(process.pid, (err, stat) => {
28-
this.uptime = Math.floor(process.uptime())
29+
this.uptime = (Date.now() - this.startTime) / 1000
2930
this.cpu = stat.cpu
3031
this.memory = stat.memory
3132
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "labstack",
3-
"version": "0.21.5",
3+
"version": "0.21.6",
44
"description": "Official Node.js client library for the LabStack platform",
55
"main": "lib/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)