4 Commits

Author SHA1 Message Date
3fa94f653d 修复运行时间错误的问题
Some checks failed
Compile / build (x64, windows-latest) (push) Failing after 39s
Compile / build (x64, ubuntu-latest) (push) Failing after 2m24s
2024-10-04 08:29:49 +08:00
4cb1fcdb21 添加系统启动时间 2024-10-04 07:46:00 +08:00
657cd1a80f 添加系统启动时间 2024-10-04 07:34:28 +08:00
3d14b5a18e 添加系统启动时间 2024-10-04 07:33:16 +08:00

View File

@@ -136,13 +136,13 @@ class Client:
self.link = link
self.interval = interval
self.start_time = psutil.boot_time()
self.hardware = Hardware()
log("Client initialized",
f"Name: {self.name}({self.client_id}), Location: {self.location}, Labels: {self.labels}")
def start(self):
self.start_time = time.time()
self.observe()
while True:
@@ -187,6 +187,7 @@ class Client:
"labels": self.labels,
"location": self.location,
"uptime": int(time.time() - self.start_time),
"start_time": int(self.start_time), # 系统启动的时间
"link": self.link,
"observed_at": int(time.time()),
},