mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Added a L2ARC efficiency function, also some label consistency changes
This commit is contained in:
parent
1617487802
commit
cbe4553411
@ -18,6 +18,8 @@
|
||||
# cachehitdtype - Cache hit by data type
|
||||
# dmuprefetch - DMU prefetch
|
||||
# utilization - ARC size breakdown
|
||||
# l2utilization - L2ARC size breakdown
|
||||
# l2efficiency - L2ARC efficiency
|
||||
#
|
||||
#%# family=auto
|
||||
|
||||
@ -62,6 +64,9 @@ TARGET_SIZE=`$SYS kstat.zfs.misc.arcstats.c`
|
||||
L2_SIZE=`$SYS kstat.zfs.misc.arcstats.l2_size`
|
||||
L2_HDR_SIZE=`$SYS kstat.zfs.misc.arcstats.l2_hdr_size`
|
||||
|
||||
L2_HITS=`$SYS kstat.zfs.misc.arcstats.l2_hits`
|
||||
L2_MISSES=`$SYS kstat.zfs.misc.arcstats.l2_misses`
|
||||
|
||||
#
|
||||
# Calculation macros
|
||||
#
|
||||
@ -103,6 +108,9 @@ else
|
||||
MFU_SIZE=`echo "$TARGET_SIZE-$MRU_SIZE" | $BC`
|
||||
fi
|
||||
|
||||
L2_ACCESSES_TOTAL=`echo "$L2_HITS+$L2_MISSES" | $BC`
|
||||
L2_HIT_RATIO_PERC=`echo "scale=2 ; (100*$L2_HITS/$L2_ACCESSES_TOTAL)" | $BC`
|
||||
L2_MISS_RATIO_PERC=`echo "scale=2 ; (100*$L2_MISSES/$L2_ACCESSES_TOTAL)" | $BC`
|
||||
|
||||
efficiency() {
|
||||
if [ "$1" = "config" ]; then
|
||||
@ -111,8 +119,8 @@ efficiency() {
|
||||
echo 'graph_vlabel %'
|
||||
echo 'graph_info This graph shows the ARC Efficiency'
|
||||
|
||||
echo 'hits.label Cache Hit Ratio'
|
||||
echo 'misses.label Cache Miss Ratio'
|
||||
echo 'hits.label Hit Ratio'
|
||||
echo 'misses.label Miss Ratio'
|
||||
echo 'actual_hits.label Actual Hit Ratio'
|
||||
echo 'data_demand_efficiency.label Data Demand Efficiency'
|
||||
echo 'data_prefetch_efficiency.label Data Prefetch Efficiency'
|
||||
@ -186,8 +194,8 @@ dmuprefetch() {
|
||||
echo 'graph_vlabel %'
|
||||
echo 'graph_info This graph shows the DMU prefetch stats'
|
||||
|
||||
echo 'hits.label Hit percentage'
|
||||
echo 'misses.label Miss percentage'
|
||||
echo 'hits.label Hit Ratio'
|
||||
echo 'misses.label Miss Ratio'
|
||||
|
||||
exit 0
|
||||
else
|
||||
@ -246,6 +254,22 @@ l2utilization() {
|
||||
fi
|
||||
}
|
||||
|
||||
l2efficiency() {
|
||||
if [ "$1" = "config" ]; then
|
||||
echo 'graph_title ZFS L2ARC Efficiency'
|
||||
echo 'graph_args -u 100'
|
||||
echo 'graph_vlabel %'
|
||||
echo 'graph_info This graph shows the L2ARC Efficiency'
|
||||
|
||||
echo 'l2_hits.label Hit Ratio'
|
||||
echo 'l2_misses.label Miss Ratio'
|
||||
else
|
||||
echo 'l2_hits.value ' $L2_HIT_RATIO_PERC
|
||||
echo 'l2_misses.value ' $L2_MISS_RATIO_PERC
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
[ "$1" = "config" ] && echo "graph_category zfs"
|
||||
|
||||
case "$FUNCTION" in
|
||||
@ -267,4 +291,7 @@ case "$FUNCTION" in
|
||||
l2utilization)
|
||||
l2utilization $1
|
||||
;;
|
||||
l2efficiency)
|
||||
l2efficiency $1
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user