3 Commits

Author SHA1 Message Date
89d7fa3145 提升上报时间
Some checks failed
Compile / build (x64, windows-latest) (push) Failing after 1m54s
Compile / build (x64, ubuntu-latest) (push) Has been cancelled
2024-10-03 17:28:57 +08:00
833c96cbc5 修复CPU物理核心计算错误 2024-10-03 17:03:57 +08:00
2e4fd493c5 修复CPU物理核心计算错误 2024-10-03 17:03:15 +08:00
3 changed files with 11 additions and 2 deletions

2
.gitignore vendored
View File

@@ -122,6 +122,8 @@ celerybeat.pid
*.sage.py
pdm.lock
start.cmd
start.sh
# Environments
.env

View File

@@ -85,6 +85,13 @@ sudo systemctl enable server-status-client
sudo systemctl start server-status-client
```
### 更新
```shell
git pull
sudo systemctl restart server-status-client
```
### 服务端
请在中心服务器上部署 [server-status-server](https://github.com/snowykami/server-status-server)

View File

@@ -120,7 +120,7 @@ class Api:
class Client:
def __init__(self, addr: str, token: str, client_id: str, name: str = "", location: str = "", labels: list[str] = [], link: str = "",
interval: int = 5):
interval: int = 2):
self.api = Api(addr, {"token": token, "id": client_id})
self.api = self.api.group("/client")
self.api.add_headers(Authorization="{token}")
@@ -224,7 +224,7 @@ class Client:
self.hardware.mem_used = psutil.virtual_memory().used
self.hardware.swap_total = psutil.swap_memory().total
self.hardware.swap_used = psutil.swap_memory().used
self.hardware.cpu_cores = psutil.cpu_count()
self.hardware.cpu_cores = psutil.cpu_count(logical=False)
self.hardware.cpu_logics = psutil.cpu_count(logical=True)
for part in psutil.disk_partitions():
try: