You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lean4game/relay/stats.sh

13 lines
318 B
Bash

#!/usr/bin/env bash
# Load python interpreter
python=/usr/bin/python3
# Load python script
cpu_usage=relay/cpu_usage.py
# Execute python script
cpu=$($python $cpu_usage)
# Calculate memory usage by computing 1 - %free_memory
mem=$(free | sed '2q;d' | awk '{print 1 - ($4/$2)}')
printf "CPU, MEM\n%f, %f\n" $cpu $mem