Biduleohm

ARC stats

Mar 4th, 2015
2,092
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. arcSummary="$(python /usr/local/www/freenasUI/tools/arc_summary.py)"
  4. pools="$(zpool list -H -o name)"
  5.  
  6. echo ""
  7. echo "[LIST]"
  8. echo "[*]Put your data type(s) here..."
  9. echo "[*]$(uptime)"
  10.  
  11. for pool in $pools
  12. do
  13.     used="$(zpool list -H -o allocated ${pool})"
  14.     total="$(zpool list -H -o size ${pool})"
  15.  
  16.     echo "[*]${used}iB / ${total}iB (${pool})"
  17. done
  18.  
  19. arc="$(echo "${arcSummary}" | grep -m 1 "ARC Size:" | awk '{print $4 $5}')"
  20. sizeMRU="$(echo "${arcSummary}" | grep "Recently Used Cache Size:" | awk '{print $6 $7}')"
  21. sizeMFU="$(echo "${arcSummary}" | grep "Frequently Used Cache Size:" | awk '{print $6 $7}')"
  22. ram="$(echo "${arcSummary}" | grep "Real Installed:" | awk '{print $3 $4}')"
  23.  
  24. hit="$(echo "${arcSummary}" | grep "Cache Hit Ratio:" | awk '{print $4}')"
  25. pre="$(echo "${arcSummary}" | grep "Data Prefetch Efficiency:" | awk '{print $4}')"
  26.  
  27. hitMRU="$(echo "${arcSummary}" | grep "Most Recently Used:" | awk '{print $4}')"
  28. hitMFU="$(echo "${arcSummary}" | grep "Most Frequently Used:" | awk '{print $4}')"
  29. hitMRUG="$(echo "${arcSummary}" | grep "Most Recently Used Ghost:" | awk '{print $5}')"
  30. hitMFUG="$(echo "${arcSummary}" | grep "Most Frequently Used Ghost:" | awk '{print $5}')"
  31.  
  32. echo "[*]${arc} (MRU: ${sizeMRU}, MFU: ${sizeMFU}) / ${ram}"
  33. echo "[*]Hit ratio -> ${hit} (higher is better)"
  34. echo "[*]Prefetch -> ${pre} (higher is better)"
  35. echo "[*]Hit MFU:MRU -> ${hitMFU}:${hitMRU} (higher ratio is better)"
  36. echo "[*]Hit MRU Ghost -> ${hitMRUG} (lower is better)"
  37. echo "[*]Hit MFU Ghost -> ${hitMFUG} (lower is better)"
  38. echo "[/LIST]"
  39. echo ""
RAW Paste Data