mirror of
https://github.com/snowykami/server-status-client.git
synced 2026-04-26 11:55:36 +00:00
Compare commits
4 Commits
2c3cda6e46
...
3fa94f653d
| Author | SHA1 | Date | |
|---|---|---|---|
| 3fa94f653d | |||
| 4cb1fcdb21 | |||
| 657cd1a80f | |||
| 3d14b5a18e |
@@ -136,13 +136,13 @@ class Client:
|
|||||||
self.link = link
|
self.link = link
|
||||||
self.interval = interval
|
self.interval = interval
|
||||||
|
|
||||||
|
self.start_time = psutil.boot_time()
|
||||||
self.hardware = Hardware()
|
self.hardware = Hardware()
|
||||||
|
|
||||||
log("Client initialized",
|
log("Client initialized",
|
||||||
f"Name: {self.name}({self.client_id}), Location: {self.location}, Labels: {self.labels}")
|
f"Name: {self.name}({self.client_id}), Location: {self.location}, Labels: {self.labels}")
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
self.start_time = time.time()
|
|
||||||
self.observe()
|
self.observe()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@@ -187,6 +187,7 @@ class Client:
|
|||||||
"labels": self.labels,
|
"labels": self.labels,
|
||||||
"location": self.location,
|
"location": self.location,
|
||||||
"uptime": int(time.time() - self.start_time),
|
"uptime": int(time.time() - self.start_time),
|
||||||
|
"start_time": int(self.start_time), # 系统启动的时间
|
||||||
"link": self.link,
|
"link": self.link,
|
||||||
"observed_at": int(time.time()),
|
"observed_at": int(time.time()),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user