Skip to content

Commit e4220fb

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

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

labstack/cube.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def __init__(self, api_key, node=socket.gethostname(), batch_size=60,
1717
self.batch_size = batch_size
1818
self.dispatch_interval = dispatch_interval
1919
self.tags = tags
20+
self.start_time = time.time()
2021
self.uptime = 0
2122
self.cpu = 0.0
2223
self.memory = 0
@@ -26,7 +27,7 @@ def __init__(self, api_key, node=socket.gethostname(), batch_size=60,
2627

2728
def system():
2829
p = psutil.Process(os.getpid())
29-
self.uptime = int(datetime.now().timestamp() - p.create_time())
30+
self.uptime = int(time.time() - self.start_time)
3031
self.cpu = p.cpu_percent()
3132
self.memory = p.memory_full_info().rss
3233

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='labstack',
5-
version='0.21.2',
5+
version='0.21.3',
66
description='Official Python client library for the LabStack platform',
77
long_description='`<https://github.com/labstack/labstack-python>`_',
88
keywords='api, testing, monitoring, analytics',

0 commit comments

Comments
 (0)