指令的同时执行

2024-05-03 15:35:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试从一个系统中的不同计算机获取CPU日志。我有一个python脚本,它以不同的时间戳获取一台计算机的日志。现在把它集成到一个计算机系统中需要不同计算机在同一时间戳上的日志。你知道吗

Let's consider I have Computer A and Computer B. I execute the command on my server at timestamp X, now Logs are collected at time X on computer A and the output file is received on server. Now Log would be received from the Computer B at time X+delta X(as delta X amount has passed in execution on computer A) and the output would be received on server.

我希望两个日志以相同的时间戳接收。我想到了多线程,但是在一个大系统上创建太多线程是行不通的。有更好的选择吗?。你知道吗

谢谢

PS:我使用psutil收集日志,使用ssh登录远程服务器


Tags: andtheoutputservertimeon系统计算机