Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / zfs / zfs_cache_efficiency @ 17f78427

Historique | Voir | Annoter | Télécharger (7,29 ko)

1
#!/bin/sh
2
# ZFS ARC statistics for FreeBSD
3
# Author alex@trull.org:
4
#
5
#%# family=auto
6
#%# capabilities=autoconf
7

    
8
sysctl='/sbin/sysctl'
9
ostype=`uname -s`
10
procfile='/proc/spl/kstat/zfs/arcstats'
11

    
12
case $1 in
13
    config)
14
    cat <<EOF
15
graph_title ZFS ARC efficiency
16
graph_vlabel %
17
graph_scale no
18
graph_category fs
19
graph_args -l 0
20
graph_info FreeBSD ZFS ARC Utilisation - Counters
21
graph_period minute
22
graph_order hits misses l2_hits l2_misses mfu_hits mru_hits arc_access_total mfu_hits_perc mru_hits_perc arc_misses_perc l2_efficency_tot
23
deleted.graph no
24
deleted.min 0
25
deleted.type DERIVE
26
deleted.label Deleted?
27
demand_data_hits.graph no
28
demand_data_hits.min 0
29
demand_data_hits.type DERIVE
30
demand_data_hits.label Cache hits - demand data
31
demand_data_misses.graph no
32
demand_data_misses.min 0
33
demand_data_misses.type DERIVE
34
demand_data_misses.label Cache miss - demand data
35
demand_metadata_hits.graph no
36
demand_metadata_hits.min 0
37
demand_metadata_hits.type DERIVE
38
demand_metadata_hits.label Cache hits - metadata
39
demand_metadata_misses.graph no
40
demand_metadata_misses.min 0
41
demand_metadata_misses.type DERIVE
42
demand_metadata_misses.label Cache miss - metadata
43
evict_skip.graph no
44
evict_skip.min 0
45
evict_skip.type DERIVE
46
evict_skip.label evict_skip?
47
hash_chain_max.graph no
48
hash_chain_max.min 0
49
hash_chain_max.type DERIVE
50
hash_chain_max.label hash_chain_max?
51
hash_chains.graph no
52
hash_chains.min 0
53
hash_chains.type DERIVE
54
hash_chains.label hash_chains?
55
hash_collisions.graph no
56
hash_collisions.min 0
57
hash_collisions.type DERIVE
58
hash_collisions.label hash_collisions?
59
hash_elements.graph no
60
hash_elements.min 0
61
hash_elements.type DERIVE
62
hash_elements.label hash_elements
63
hash_elements_max.graph no
64
hash_elements_max.min 0
65
hash_elements_max.type DERIVE
66
hash_elements_max.label hash_elements_max?
67
hits.graph no
68
hits.min 0
69
hits.type DERIVE
70
hits.label Cache hits
71
l2_abort_lowmem.graph no
72
l2_abort_lowmem.min 0
73
l2_abort_lowmem.type GAUGE
74
l2_cksum_bad.graph no
75
l2_cksum_bad.min 0
76
l2_cksum_bad.type DERIVE
77
l2_cksum_bad.label ARCL2 Bad checksum errors
78
l2_evict_lock_retry.graph no
79
l2_evict_lock_retry.min 0
80
l2_evict_lock_retry.type DERIVE
81
l2_evict_reading.graph no
82
l2_evict_reading.min 0
83
l2_evict_reading.type DERIVE
84
l2_feeds.graph no
85
l2_feeds.min 0
86
l2_feeds.type DERIVE
87
l2_free_on_write.graph no
88
l2_free_on_write.min 0
89
l2_free_on_write.type DERIVE
90
l2_hits.graph no
91
l2_hits.min 0
92
l2_hits.type DERIVE
93
l2_hits.label L2ARC hits
94
l2_io_error.graph no
95
l2_io_error.min 0
96
l2_io_error.type DERIVE
97
l2_io_error.label L2AC I/O errors
98
l2_misses.graph no
99
l2_misses.min 0
100
l2_misses.type DERIVE
101
l2_misses.label L2ARC cache misses
102
l2_rw_clash.graph no
103
l2_rw_clash.min 0
104
l2_rw_clash.type DERIVE
105
l2_writes_done.graph no
106
l2_writes_done.min 0
107
l2_writes_done.type DERIVE
108
l2_writes_error.graph no
109
l2_writes_error.min 0
110
l2_writes_error.type DERIVE
111
l2_writes_hdr_miss.graph no
112
l2_writes_hdr_miss.min 0
113
l2_writes_hdr_miss.type DERIVE
114
l2_writes_hdr_miss.label L2ARC Header misses
115
l2_writes_sent.graph no
116
l2_writes_sent.min 0
117
l2_writes_sent.type DERIVE
118
l2_writes_sent.label L2ARC writes sent
119
memory_throttle_count.graph no
120
memory_throttle_count.min 0
121
memory_throttle_count.label memory_throttle_count?
122
mfu_ghost_hits.graph no
123
mfu_ghost_hits.min 0
124
mfu_ghost_hits.type DERIVE
125
mfu_ghost_hits.label Most frequently used ghost hits
126
mfu_hits.graph no
127
mfu_hits.min 0
128
mfu_hits.type DERIVE
129
mfu_hits.label Most frequently used hits
130
misses.graph no
131
misses.min 0
132
misses.type DERIVE
133
misses.label Cache misses
134
mru_ghost_hits.graph no
135
mru_ghost_hits.min 0
136
mru_ghost_hits.type DERIVE
137
mru_ghost_hits.label Most recently used ghost hits
138
mru_hits.graph no
139
mru_hits.min 0
140
mru_hits.type DERIVE
141
mru_hits.label Most recently used hits
142
mutex_miss.graph no
143
mutex_miss.min 0
144
mutex_miss.type DERIVE
145
prefetch_data_hits.graph no
146
prefetch_data_hits.min 0
147
prefetch_data_hits.type DERIVE
148
prefetch_data_hits.label Prefetch Data hits
149
prefetch_data_misses.graph no
150
prefetch_data_misses.min 0
151
prefetch_data_misses.type DERIVE
152
prefetch_data_misses.label Prefetch data misses
153
prefetch_metadata_hits.graph no
154
prefetch_metadata_hits.min 0
155
prefetch_metadata_hits.type DERIVE
156
prefetch_metadata_hits.label Prefetch metadata hits
157
prefetch_metadata_misses.graph no
158
prefetch_metadata_misses.min 0
159
prefetch_metadata_misses.type DERIVE
160
prefetch_metadata_misses.label Prefetch metadata misses
161
recycle_miss.graph no
162
recycle_miss.min 0
163
recycle_miss.type DERIVE
164
recycle_miss.label Recycle misses
165
arc_access_total.graph no
166
arc_access_total.cdef hits,misses,ADDNAN
167
arc_access_total.label ARC access total number
168
arc_hits_perc.cdef hits,100,*,arc_access_total,/
169
arc_hits_perc.label ARC hits
170
arc_hits_perc.graph no
171
real_hits.cdef mfu_hits,mru_hits,ADDNAN,100,*,hits,/
172
real_hits.label ARC real (MRU + MFU) hits (no ghost & anon)
173
real_hits.graph no
174
mfu_hits_perc.cdef mfu_hits,100,*,arc_access_total,/
175
mfu_hits_perc.label Most frequently used hits
176
mfu_hits_perc.graph yes
177
mfu_hits_perc.draw AREA
178
mru_hits_perc.cdef mru_hits,100,*,arc_access_total,/
179
mru_hits_perc.label Most recently used hits
180
mru_hits_perc.graph yes
181
mru_hits_perc.draw STACK
182
arc_misses_perc.graph yes
183
arc_misses_perc.cdef misses,100,*,arc_access_total,/
184
arc_misses_perc.label ARC misses
185
arc_misses_perc.draw STACK
186
l2_efficency_tot.graph yes
187
l2_efficency_tot.cdef l2_hits,100,*,l2_hits,l2_misses,hits,misses,ADDNAN,ADDNAN,ADDNAN,/
188
l2_efficency_tot.label L2ARC hit ratio of L1&L2 accesses
189
EOF
190
# demand_data_hits_perc.cdef demand_data_hits,100,*,hits,/
191
# demand_data_hits_perc.label Cache hits of demand data type
192
# demand_data_hits_perc.graph no
193
# demand_metadata_hits_perc.cdef demand_metadata_hits,100,*,hits,/
194
# demand_metadata_hits_perc.label Cache hits of Demand metadata type
195
# demand_metadata_hits_perc.graph no
196
# prefetch_data_hits_perc.cdef prefetch_data_hits,100,*,hits,/
197
# prefetch_data_hits_perc.label Prefetch data hits factor of all hits
198
# prefetch_data_hits_perc.graph no
199
# prefetch_metadata_hits_perc.cdef prefetch_metadata_hits,100,*,hits,/
200
# prefetch_metadata_hits_perc.label Prefetch metadata hits factor off hits
201
# prefetch_metadata_hits_perc.graph no
202
# demand_data_efficency.cdef demand_data_hits,100,*,demand_data_hits,demand_data_misses,ADDNAN,/
203
# demand_data_efficency.label Data demand efficiency
204
# demand_data_efficency.graph no
205
# anon_hits.graph no
206
# anon_hits.cdef hits,mfu_hits,mru_hits,mfu_ghost_hits,mru_ghost_hits,ADDNAN,ADDNAN,ADDNAN,-,100,*,hits,/
207
# anon_hits.label ARC Anon hits
208
# mfu_ghost_hits_perc.cdef mfu_ghost_hits,100,*,hits,/
209
# mfu_ghost_hits_perc.label Most frequently used ghost hits
210
# mfu_ghost_hits_perc.graph no
211
# mru_ghost_hits_perc.cdef mru_ghost_hits,100,*,hits,/
212
# mru_ghost_hits_perc.label Most recently used ghost hits
213
# mru_ghost_hits_perc.graph no
214
    exit 0
215
    ;;
216
    autoconf)
217
    if [ ! -x ${sysctl} ]; then
218
        echo "no (${sysctl} is not executable)"
219
        exit 1
220
    fi
221
    if [ ${ostype} = "FreeBSD" ]; then
222
        echo "yes"
223
        exit 0
224
    fi
225
    if [ ${ostype} = "Linux" ]; then
226
        if [ -f ${procfile} ]; then
227
            echo "yes"
228
            exit 0
229
        fi
230
        echo "no (The statsfile does not exist: ${procfile})"
231
        exit 1
232
    fi
233
    echo "no (You're OS is not supported by this plugin)"
234
    exit 1
235
    ;;
236
    suggest)
237
    exit 0
238
    ;;
239
esac
240
case ${ostype} in
241
    "FreeBSD")
242
        $sysctl kstat.zfs.misc.arcstats | sed -e 's/^kstat.zfs.misc.arcstats.//' -e 's/:/.value/'
243
    ;;
244
    "Linux")
245
        cat ${procfile} | tail -n +3 | sed -e 's/ \+/ /g' | cut -f 1,3 -d ' ' | sed -e 's/ /.value /'
246
    ;;
247
esac