Last active
December 17, 2015 10:08
-
-
Save szaydel/5592065 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
#!/bin/bash | |
user_custom_limit=$1 | |
var_def_limit='480' | |
var_limit=${user_custom_limit:-${var_def_limit}} | |
## var_slow=100 ## // Not needed in this script. | |
output_log=/root/arc-lat-$(date +"%Y%m%d").log | |
exec 1> $output_log | |
dtrace -qn 'inline int OPT_limit = '$var_limit'; BEGIN {cnt=0; } ::arc_adjust:entry { self->ts = timestamp } ::arc_adjust:return {@["Time (us):"] = quantize((timestamp - self->ts)/1000); self->ts = 0; } tick-60sec { cnt++; } tick-60sec / cnt > OPT_limit / {exit(0); } END {printa("%16s %@d\n", @)}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment