Created
April 11, 2023 09:38
-
-
Save bhuiyanmobasshir94/537165af5f23c8d90fa49671aae193dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psutil | |
# Measure CPU utilization | |
cpu_utilization = psutil.cpu_percent() | |
print("CPU utilization:", cpu_utilization) | |
# Measure memory usage | |
memory_usage = psutil.virtual_memory().percent | |
print("Memory usage:", memory_usage) | |
# Measure disk I/O | |
disk_io = psutil.disk_io_counters().read_count | |
print("Disk I/O:", disk_io) | |
# Measure network traffic | |
network_traffic = psutil.net_io_counters().bytes_sent + psutil.net_io_counters().bytes_recv | |
print("Network traffic:", network_traffic) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment