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
#!/usr/bin/env python3 | |
from typing import Dict | |
def switch(cases: Dict[str, str], default='UNDEFINED', separator='\n'): | |
# ["IfThenElse(ac, am", "IfThenElse(bc, bm", "IfThenElse(cc, cm", ...] | |
switch_expression = separator.join( | |
f"IfThenElse({condition}, {on_match}," | |
for condition, on_match in cases.items() | |
) |
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
What exactly is "iowait"? | |
To summarize it in one sentence, 'iowait' is the percentage | |
of time the CPU is idle AND there is at least one I/O | |
in progress. | |
Each CPU can be in one of four states: user, sys, idle, iowait. | |
Performance tools such as vmstat, iostat, sar, etc. print | |
out these four states as a percentage. The sar tool can | |
print out the states on a per CPU basis (-P flag) but most |