Count the number of swap devices in use
()
| 38 | |
| 39 | |
| 40 | def count_swap_linux(): |
| 41 | """Count the number of swap devices in use""" |
| 42 | count = 0 |
| 43 | with open("/proc/swaps") as f: |
| 44 | for line in f: |
| 45 | if line[0] == '/': |
| 46 | count += 1 |
| 47 | return count |
| 48 | |
| 49 | |
| 50 | def get_proc_swaps(): |
no outgoing calls