Skip to content

Commit

Permalink
Drop swap support
Browse files Browse the repository at this point in the history
  • Loading branch information
marxin committed Feb 11, 2024
1 parent 39c2b83 commit d3749a1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions usage-wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,10 @@ def difference_in_gb(self):
cpu_stats = DataStatistic(lambda: psutil.cpu_percent(interval=args.frequency) * cpu_scale)
mem_stats = DataStatistic(lambda: to_gigabyte(psutil.virtual_memory().used))
load_stats = DataStatistic(lambda: 100 * psutil.getloadavg()[0] / cpu_count)
swap_stats = DataStatistic(lambda: to_gigabyte(psutil.swap_memory().used))
disk_read_stats = DiskDataStatistic(lambda: to_megabyte((1 / INTERVAL) * (psutil.disk_io_counters().read_bytes)))
disk_write_stats = DiskDataStatistic(lambda: to_megabyte((1 / INTERVAL) * (psutil.disk_io_counters().write_bytes)))

collectors = [cpu_stats, mem_stats, load_stats, swap_stats, disk_read_stats, disk_write_stats]
collectors = [cpu_stats, mem_stats, load_stats, disk_read_stats, disk_write_stats]

try:
import GPUtil
Expand Down Expand Up @@ -271,16 +270,14 @@ def get_footnote():


def get_footnote2():
peak_swap = swap_stats.maximum()
total_swap = to_gigabyte(psutil.swap_memory().total)
disk_total = disk_data_total
disk_start = disk_data_start
disk_end = to_gigabyte(psutil.disk_usage('.').used)
total_read = disk_read_stats.difference_in_gb()
total_written = disk_write_stats.difference_in_gb()
load_max = load_stats.maximum()
return (f'taken: {int(timestamps[-1])} s;'
f' load max (1m): {load_max:.0f}%; swap peak/total: {peak_swap:.1f}/{total_swap:.1f} GiB;'
f' load max (1m): {load_max:.0f}%;'
f' disk start/end/total: {disk_start:.1f}/{disk_end:.1f}/{disk_total:.1f} GiB;'
f' total read/write GiB: {total_read:.1f}/{total_written:.1f}')

Expand Down

0 comments on commit d3749a1

Please sign in to comment.