Skip to content

Commit dc55269

Browse files
authored
Feat/Env add PID and verbose Python version (#615)
1 parent cabf0b6 commit dc55269

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

swanlab/data/run/system/info.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import multiprocessing
1515
import pynvml
1616
from swanlab.log import swanlog
17+
import os
1718

1819

1920
def __replace_second_colon(input_string, replacement):
@@ -231,10 +232,11 @@ def get_system_info(version: str, logdir: str):
231232
:param logdir: swanlab日志目录
232233
"""
233234
return {
234-
"swanlab": {"version": version, "logdir": logdir},
235-
"hostname": socket.gethostname(),
236-
"os": platform.platform(),
237-
"python": platform.python_version(),
235+
"swanlab": {"version": version, "logdir": logdir}, # swanlab 版本号和日志目录
236+
"hostname": socket.gethostname(), # 主机名
237+
"os": platform.platform(), # 操作系统
238+
"python": platform.python_version(), # python版本
239+
"python_verbose": sys.version, # python详细版本
238240
"executable": sys.executable, # python 解释器路径
239241
"git_remote": __get_remote_url(), # 获取远程仓库的链接
240242
"cpu": multiprocessing.cpu_count(), # cpu 核心数
@@ -243,4 +245,5 @@ def get_system_info(version: str, logdir: str):
243245
"command": __get_command(), # 完整命令行信息
244246
"memory": __get_memory_size(), # 内存大小
245247
"cwd": __get_cwd(), # 当前工作目录路径
248+
"pid": os.getpid(), # 当前进程ID
246249
}

0 commit comments

Comments
 (0)