From 8315962063d51a9cbc7eb01f5232b79e7209baa8 Mon Sep 17 00:00:00 2001 From: dabb Date: Fri, 24 Feb 2012 11:51:03 +0000 Subject: [PATCH 1/6] Fixing typos in data type calculations --- plugins/zfs/zfs_stats_ | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/zfs/zfs_stats_ b/plugins/zfs/zfs_stats_ index d218e46d..bef05684 100755 --- a/plugins/zfs/zfs_stats_ +++ b/plugins/zfs/zfs_stats_ @@ -83,13 +83,13 @@ MOST_RECENTLY_USED_GHOST_PERC=`echo "scale=2 ; (100*$MRU_GHOST_HITS/$ARC_HITS)" MOST_FREQUENTLY_USED_GHOST_PERC=`echo "scale=2 ; (100*$MFU_GHOST_HITS/$ARC_HITS)" | $BC` DEMAND_DATA_HIT_PERC=`echo "scale=2 ; (100*$DEMAND_DATA_HITS/$ARC_HITS)" | $BC` -DEMAND_DATA_MISS_PERC=`echo "scale=2 ; (100*$DEMAND_DATA_MISSES/$ARC_HITS)" | $BC` +DEMAND_DATA_MISS_PERC=`echo "scale=2 ; (100*$DEMAND_DATA_MISSES/$ARC_MISSES)" | $BC` PREFETCH_DATA_HIT_PERC=`echo "scale=2 ; (100*$PREFETCH_DATA_HITS/$ARC_HITS)" | $BC` -PREFETCH_DATA_MISS_PERC=`echo "scale=2 ; (100*$PREFETCH_DATA_MISSES/$ARC_HITS)" | $BC` +PREFETCH_DATA_MISS_PERC=`echo "scale=2 ; (100*$PREFETCH_DATA_MISSES/$ARC_MISSES)" | $BC` DEMAND_METADATA_HIT_PERC=`echo "scale=2 ; (100*$DEMAND_METADATA_HITS/$ARC_HITS)" | $BC` -DEMAND_METADATA_MISS_PERC=`echo "scale=2 ; (100*$DEMAND_METADATA_MISSES/$ARC_HITS)" | $BC` +DEMAND_METADATA_MISS_PERC=`echo "scale=2 ; (100*$DEMAND_METADATA_MISSES/$ARC_MISSES)" | $BC` PREFETCH_METADATA_HIT_PERC=`echo "scale=2 ; (100*$PREFETCH_METADATA_HITS/$ARC_HITS)" | $BC` -PREFETCH_METADATA_MISSES_PERC=`echo "scale=2 ; (100*$PREFETCH_METADATA_MISSES/$ARC_HITS)" | $BC` +PREFETCH_METADATA_MISSES_PERC=`echo "scale=2 ; (100*$PREFETCH_METADATA_MISSES/$ARC_MISSES)" | $BC` DMU_TOTAL=`echo "$DMU_HITS+$DMU_MISSES" | $BC` DMU_HITS_PERC=`echo "scale=2 ; (100*$DMU_HITS/$DMU_TOTAL)" | $BC` From 6b7922c3793e6d4b8d92b7e1dafc75a9a41e9a7d Mon Sep 17 00:00:00 2001 From: dabb Date: Fri, 24 Feb 2012 12:46:10 +0000 Subject: [PATCH 2/6] Removing unnecessary graph_category attributes --- plugins/zfs/zfs_stats_ | 5 ----- 1 file changed, 5 deletions(-) diff --git a/plugins/zfs/zfs_stats_ b/plugins/zfs/zfs_stats_ index bef05684..d062c562 100755 --- a/plugins/zfs/zfs_stats_ +++ b/plugins/zfs/zfs_stats_ @@ -108,7 +108,6 @@ efficiency() { echo 'graph_title ZFS ARC Efficiency' echo 'graph_args -u 100' echo 'graph_vlabel %' - echo 'graph_category ZFS' echo 'graph_info This graph shows the ARC Efficiency' echo 'hits.label Cache Hit Ratio' @@ -132,7 +131,6 @@ cachehitlist() { echo 'graph_title ZFS ARC Efficiency: Cache hits by cache list' echo 'graph_args -u 100' echo 'graph_vlabel %' - echo 'graph_category ZFS' echo 'graph_info This graph shows the ARC Efficiency' echo 'cache_list_anon.label Anonymously Used' @@ -156,7 +154,6 @@ cachehitdtype() { echo 'graph_title ZFS ARC Efficiency: Cache hits by data type' echo 'graph_args -u 100' echo 'graph_vlabel %' - echo 'graph_category ZFS' echo 'graph_info This graph shows the ARC Efficiency' echo 'data_type_demand_hits.label Demand Data Hit Ratio' @@ -187,7 +184,6 @@ dmuprefetch() { echo 'graph_title ZFS DMU prefetch stats' echo 'graph_args -u 100' echo 'graph_vlabel %' - echo 'graph_category ZFS' echo 'graph_info This graph shows the DMU prefetch stats' echo 'hits.label Hit percentage' @@ -206,7 +202,6 @@ utilization() { echo 'graph_title ZFS ARC Size' echo 'graph_args --base 1024 -l 0 --vertical-label Bytes --upper-limit '$MEMMAX echo 'graph_vlabel Size in MB' - echo 'graph_category ZFS' echo 'graph_info This graph shows the ARC Size utilization' echo 'max_size.label Maximum Size' From 20cc0e049134bf8869a57163bd54672ea279b99f Mon Sep 17 00:00:00 2001 From: dabb Date: Fri, 24 Feb 2012 13:30:14 +0000 Subject: [PATCH 3/6] Added a L2ARC size function and some cleanup --- plugins/zfs/zfs_stats_ | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/plugins/zfs/zfs_stats_ b/plugins/zfs/zfs_stats_ index d062c562..81265ecd 100755 --- a/plugins/zfs/zfs_stats_ +++ b/plugins/zfs/zfs_stats_ @@ -59,6 +59,8 @@ MAX_SIZE=`$SYS kstat.zfs.misc.arcstats.c_max` MIN_SIZE=`$SYS kstat.zfs.misc.arcstats.c_min` 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` # # Calculation macros @@ -103,7 +105,6 @@ fi efficiency() { - if [ "$1" = "config" ]; then echo 'graph_title ZFS ARC Efficiency' echo 'graph_args -u 100' @@ -179,7 +180,6 @@ cachehitdtype() { } dmuprefetch() { - if [ "$1" = "config" ]; then echo 'graph_title ZFS DMU prefetch stats' echo 'graph_args -u 100' @@ -197,7 +197,6 @@ dmuprefetch() { } utilization() { - if [ "$1" = "config" ]; then echo 'graph_title ZFS ARC Size' echo 'graph_args --base 1024 -l 0 --vertical-label Bytes --upper-limit '$MEMMAX @@ -228,6 +227,25 @@ utilization() { fi } +l2utilization() { + if [ "$1" = "config" ]; then + echo 'graph_title ZFS L2ARC Size' + echo 'graph_args --base 1024 -r -l 0 --vertical-label Bytes' + echo 'graph_vlabel Size in MB' + echo 'graph_info This graph shows the L2ARC Size utilization' + + echo 'size.label Size' + echo 'size.draw AREA' + echo 'hdr_size.label Header Size' + echo 'hdr_size.draw AREA' + + exit 0 + else + echo 'size.value ' $L2_SIZE + echo 'hdr_size.value ' $L2_HDR_SIZE + fi +} + [ "$1" = "config" ] && echo "graph_category zfs" case "$FUNCTION" in @@ -246,4 +264,7 @@ case "$FUNCTION" in utilization) utilization $1 ;; + l2utilization) + l2utilization $1 + ;; esac From 55ba113d2f40c570ec9c7b8b750f8d8e6a895815 Mon Sep 17 00:00:00 2001 From: David Bjornsson Date: Fri, 24 Feb 2012 14:36:50 +0000 Subject: [PATCH 4/6] Added a L2ARC efficiency function, also some label consistency changes --- plugins/zfs/zfs_stats_ | 44 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/plugins/zfs/zfs_stats_ b/plugins/zfs/zfs_stats_ index 81265ecd..64d5657a 100755 --- a/plugins/zfs/zfs_stats_ +++ b/plugins/zfs/zfs_stats_ @@ -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 @@ -61,6 +63,12 @@ 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` +<<<<<<< HEAD + +L2_HITS=`$SYS kstat.zfs.misc.arcstats.l2_hits` +L2_MISSES=`$SYS kstat.zfs.misc.arcstats.l2_misses` +======= +>>>>>>> 20cc0e049134bf8869a57163bd54672ea279b99f # # Calculation macros @@ -103,6 +111,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 +122,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 +197,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 +257,25 @@ l2utilization() { fi } +<<<<<<< HEAD +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 + +} + +======= +>>>>>>> 20cc0e049134bf8869a57163bd54672ea279b99f [ "$1" = "config" ] && echo "graph_category zfs" case "$FUNCTION" in @@ -267,4 +297,10 @@ case "$FUNCTION" in l2utilization) l2utilization $1 ;; +<<<<<<< HEAD + l2efficiency) + l2efficiency $1 + ;; +======= +>>>>>>> 20cc0e049134bf8869a57163bd54672ea279b99f esac From 16174878027ef15d92395c83e4640ab4153ee507 Mon Sep 17 00:00:00 2001 From: David Bjornsson Date: Fri, 24 Feb 2012 14:42:21 +0000 Subject: [PATCH 5/6] Revert "Added a L2ARC efficiency function, also some label consistency changes" This reverts commit 55ba113d2f40c570ec9c7b8b750f8d8e6a895815. --- plugins/zfs/zfs_stats_ | 44 ++++-------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/plugins/zfs/zfs_stats_ b/plugins/zfs/zfs_stats_ index 64d5657a..81265ecd 100755 --- a/plugins/zfs/zfs_stats_ +++ b/plugins/zfs/zfs_stats_ @@ -18,8 +18,6 @@ # cachehitdtype - Cache hit by data type # dmuprefetch - DMU prefetch # utilization - ARC size breakdown -# l2utilization - L2ARC size breakdown -# l2efficiency - L2ARC efficiency # #%# family=auto @@ -63,12 +61,6 @@ 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` -<<<<<<< HEAD - -L2_HITS=`$SYS kstat.zfs.misc.arcstats.l2_hits` -L2_MISSES=`$SYS kstat.zfs.misc.arcstats.l2_misses` -======= ->>>>>>> 20cc0e049134bf8869a57163bd54672ea279b99f # # Calculation macros @@ -111,9 +103,6 @@ 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 @@ -122,8 +111,8 @@ efficiency() { echo 'graph_vlabel %' echo 'graph_info This graph shows the ARC Efficiency' - echo 'hits.label Hit Ratio' - echo 'misses.label Miss Ratio' + echo 'hits.label Cache Hit Ratio' + echo 'misses.label Cache 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' @@ -197,8 +186,8 @@ dmuprefetch() { echo 'graph_vlabel %' echo 'graph_info This graph shows the DMU prefetch stats' - echo 'hits.label Hit Ratio' - echo 'misses.label Miss Ratio' + echo 'hits.label Hit percentage' + echo 'misses.label Miss percentage' exit 0 else @@ -257,25 +246,6 @@ l2utilization() { fi } -<<<<<<< HEAD -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 - -} - -======= ->>>>>>> 20cc0e049134bf8869a57163bd54672ea279b99f [ "$1" = "config" ] && echo "graph_category zfs" case "$FUNCTION" in @@ -297,10 +267,4 @@ case "$FUNCTION" in l2utilization) l2utilization $1 ;; -<<<<<<< HEAD - l2efficiency) - l2efficiency $1 - ;; -======= ->>>>>>> 20cc0e049134bf8869a57163bd54672ea279b99f esac From cbe45534113dcc742115bc8a68daaa2aeb18b79a Mon Sep 17 00:00:00 2001 From: David Bjornsson Date: Fri, 24 Feb 2012 14:45:26 +0000 Subject: [PATCH 6/6] Added a L2ARC efficiency function, also some label consistency changes --- plugins/zfs/zfs_stats_ | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/plugins/zfs/zfs_stats_ b/plugins/zfs/zfs_stats_ index 81265ecd..a9d9801e 100755 --- a/plugins/zfs/zfs_stats_ +++ b/plugins/zfs/zfs_stats_ @@ -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