Skip to content

Commit

Permalink
Merge pull request #1 from alunAlunnnnn/dev
Browse files Browse the repository at this point in the history
update README.md from branch dev
  • Loading branch information
alunAlunnnnn authored Sep 24, 2021
2 parents cf1a7a5 + 295781f commit a920fd9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 的空间,所以当长时间监控,并且收集间隔很短的时候,一定要注意空间占用的问题




Expand All @@ -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


Expand Down
Binary file modified __pycache__/sys_monitor_cli.cpython-39.pyc
Binary file not shown.
12 changes: 6 additions & 6 deletions _get_sys_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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 = {}
Expand All @@ -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 = {}
Expand All @@ -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 = {}
Expand Down Expand Up @@ -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 = {}
Expand All @@ -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"):
Expand Down

0 comments on commit a920fd9

Please sign in to comment.