quicksysmon 1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="$PROJECT_DIR$/.venv" project-jdk-type="Python SDK" />
4
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/quicksysmon.iml" filepath="$PROJECT_DIR$/.idea/quicksysmon.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module external.system.id="pyproject.toml" type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <sourceFolder url="file://$MODULE_DIR$/src" />
6
+ <excludeFolder url="file://$MODULE_DIR$/.venv" />
7
+ </content>
8
+ <orderEntry type="jdk" jdkName="$MODULE_DIR$/.venv" jdkType="Python SDK" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ </component>
11
+ <component name="PackageRequirementsSettings" />
12
+ <component name="ReSTService" />
13
+ </module>
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.5
2
+ Name: quicksysmon
3
+ Version: 1.0
4
+ Summary: Fast CLI system hardware monitor for Linux
5
+ Requires-Python: >=3.8
6
+ Requires-Dist: psutil
File without changes
@@ -0,0 +1,17 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "quicksysmon"
7
+ version = "1.0"
8
+ description = "Fast CLI system hardware monitor for Linux"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ dependencies = [
12
+ "psutil",
13
+ ]
14
+
15
+
16
+ [project.scripts]
17
+ quicksysmon = "quicksysmon.quicksysmon:main"
File without changes
@@ -0,0 +1,96 @@
1
+ import psutil
2
+ import time
3
+ from datetime import datetime
4
+
5
+
6
+ def main():
7
+ print(f"\nStart time:", datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
8
+
9
+ psutil.cpu_percent()
10
+ disk_before = psutil.disk_io_counters()
11
+
12
+ result = {}
13
+ boot_time = datetime.fromtimestamp(psutil.boot_time()).strftime("%d.%m.%Y %H:%M:%S")
14
+
15
+ print("\nMeasuring the system, please wait 3 seconds:\n")
16
+
17
+ for i in range(3, 0, -1):
18
+ print(f"{i}...", end=" ", flush=True)
19
+ time.sleep(1)
20
+
21
+ disk_after = psutil.disk_io_counters()
22
+
23
+ read_speed_bytes = (disk_after.read_bytes - disk_before.read_bytes) / 3
24
+ write_speed_bytes = (disk_after.write_bytes - disk_before.write_bytes) / 3
25
+
26
+ read_speed_mb = read_speed_bytes / (1024 ** 2)
27
+ write_speed_mb = write_speed_bytes / (1024 ** 2)
28
+
29
+ print("\n\nDone! Reading the data...")
30
+
31
+ sys_info = {
32
+ "cpu": {
33
+ "cpu_usage": psutil.cpu_percent(),
34
+ "cpu_cores": psutil.cpu_count(logical=False),
35
+ "cpu_threads": psutil.cpu_count(logical=True)
36
+ },
37
+ "ram": psutil.virtual_memory(),
38
+ "disk": psutil.disk_usage("/"),
39
+ "temperature": psutil.sensors_temperatures()
40
+ }
41
+
42
+ print("-" * 25)
43
+
44
+ for user in psutil.users():
45
+ login_time = datetime.fromtimestamp(user.started).strftime("%Y-%m-%d %H:%M:%S")
46
+ print(f"""
47
+ Name: {user.name}
48
+ Terminal: {user.terminal}
49
+ Host: {user.host}
50
+ Login time: {login_time}
51
+ PID: {user.pid}
52
+ """)
53
+
54
+ print(f"System startup time: {boot_time}")
55
+
56
+ print("-" * 25)
57
+
58
+ print(f"""
59
+ CPU Information:\n
60
+ CPU Load: {sys_info["cpu"]["cpu_usage"]}%
61
+ CPU Temperature: {sys_info['temperature']['k10temp'][0].current:.1f}°C
62
+ CPU Cores: {sys_info["cpu"]["cpu_cores"]}
63
+ CPU Threads: {sys_info["cpu"]["cpu_threads"]}
64
+ """)
65
+
66
+ print("-" * 25)
67
+
68
+ print(f"""
69
+ RAM information:\n
70
+ Total: {sys_info["ram"].total / 1024 ** 3:.2f} GB
71
+ Available: {sys_info["ram"].available / 1024 ** 3:.2f} GB
72
+ Used: {sys_info["ram"].used / 1024 ** 3:.2f} GB
73
+ Percent: {sys_info["ram"].percent}%
74
+ """)
75
+
76
+ print("-" * 25)
77
+
78
+ print(f"""
79
+ Disk information:\n
80
+ Total: {sys_info["disk"].total / 1024 ** 3:.2f} GB
81
+ Available: {sys_info["disk"].free / 1024 ** 3:.2f} GB
82
+ Used: {sys_info["disk"].used / 1024 ** 3:.2f} GB
83
+ Percent: {sys_info["disk"].percent}%
84
+ Disk read speed: {read_speed_mb:.2f} MB/s
85
+ Disk write speed: {write_speed_mb:.2f} MB/s
86
+ """)
87
+
88
+ print("-" * 25)
89
+
90
+ print(f"GPU Temperature: {sys_info['temperature']['amdgpu'][0].current:.1f}°C")
91
+
92
+ print("-" * 25)
93
+
94
+
95
+ if __name__ == "__main__":
96
+ main()