From a77748b06273e9cdb6c96f8b0ec3b2dcfc9f194f Mon Sep 17 00:00:00 2001 From: alun <517308447@qq.com> Date: Fri, 24 Sep 2021 13:55:20 +0800 Subject: [PATCH 1/2] debug for linux py36 --- __pycache__/sys_monitor_cli.cpython-39.pyc | Bin 2794 -> 2794 bytes _get_sys_information.py | 12 ++++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/__pycache__/sys_monitor_cli.cpython-39.pyc b/__pycache__/sys_monitor_cli.cpython-39.pyc index 089db053368beeb441f6ea649435d870952cb0cc..249604b13a8ec752608cd0ef5c7bb26d9c2ca79d 100644 GIT binary patch delta 20 acmaDQ`bv~Lk(ZZ?0SFA8eK&I7=K=sX5d`%B delta 20 acmaDQ`bv~Lk(ZZ?0SFd^`E2CA&jkQFhXr;3 diff --git a/_get_sys_information.py b/_get_sys_information.py index d94f5d4..b13d970 100644 --- a/_get_sys_information.py +++ b/_get_sys_information.py @@ -4,7 +4,7 @@ from functools import lru_cache -@lru_cache +@lru_cache(60) def get_hrad_info(start_time): # print("func get_hrad_info") hard_info = {} @@ -37,7 +37,7 @@ def get_hrad_info(start_time): return hard_info -@lru_cache +@lru_cache(60) def _get_cpu_status(start_time): # print("func _get_cpu_status") cpu_status = {} @@ -57,7 +57,7 @@ def _get_cpu_status(start_time): return cpu_status -@lru_cache +@lru_cache(60) def _get_mem_status(start_time): # print("func _get_mem_status") mem_status = {} @@ -82,7 +82,7 @@ def _get_mem_status(start_time): return mem_status -@lru_cache +@lru_cache(60) def _get_disk_status(start_time): # print("func _get_disk_status") disk_status_res = {} @@ -111,7 +111,7 @@ def _get_disk_status(start_time): return disk_status_res -@lru_cache +@lru_cache(60) def _get_disk_capacity(time): # print("func _get_disk_capacity") disk_status = {} @@ -130,7 +130,7 @@ def _get_disk_capacity(time): return disk_status -@lru_cache() +@lru_cache(60) def _byte_convert(bytes, target_type): target_type = target_type.lower().strip() if target_type in ("k", "kb", "kilobyte"): From 295781f8bf6e27a2779a1bdd6d366f7d217de093 Mon Sep 17 00:00:00 2001 From: alun <517308447@qq.com> Date: Fri, 24 Sep 2021 15:47:04 +0800 Subject: [PATCH 2/2] update README.md --- README.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 162a0e2..1815050 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,23 @@ +版本信息: + +​ 当前版本为 v0.1,在 win 10 19042、winserver 2019 中测试可用。并且 linux_py36 分支提供对 linux 的支持,因为适配环境为 centos7.9 的 py36 所以在性能上略有下降 + +​ 目前仅支持写入 sqlite 数据库,后续会添加对 mysql、pgsql 的支持 + +​ 当前的 linux 适配版仅为过渡使用,后续会基于 python 3.9 及 python 3.9 devel 进行完整性能版的适配 + +​ 目前仅收集 CPU、RAM、DISK I/O 的信息,后续补充网络 I/O + + + + + 注意事项: 1、受限于硬盘和cpu使用率计算逻辑的影响,最小的收集间隔为 3 秒,小于 3 秒的设置不会报错,但是无法生效 +2、每次收集的数据插入 sqlite 后会占大约 1.5kb 的空间,所以当长时间监控,并且收集间隔很短的时候,一定要注意空间占用的问题 + @@ -16,19 +32,19 @@ 2、单次收集数据 ->hs_system_monitor.exe run -d D:/systemonitor.db +>hs_system_monitor.exe run -d D:/systemonitor/example.db.db 3、持续收集数据(默认间隔30秒) -> hs_system_monitor.exe run -d D:/systemonitor.db -l +> hs_system_monitor.exe run -d D:/systemonitor/example.db.db -l 4、持续收集数据(自定义间隔 此处为10秒) -> hs_system_monitor.exe run -d D:/systemonitor.db -l -s 10 +> hs_system_monitor.exe run -d D:/systemonitor/example.db.db -l -s 10