Projet

Général

Profil

Révision 17f78427

ID17f784270ae966ee9a13e9f5104a5b8f925b639e
Parent ef851f0c
Enfant d4320aea, 5b2396a9

Ajouté par Lars Kruse il y a plus de 7 ans

Whitespace cleanup

  • remove trailing whitespace
  • remove empty lines at the end of files

Voir les différences:

plugins/zfs/zfs_arcstats
25 25
  For FreeBSD, it should be necessary to change shebang /bin/bash -> /usr/local/bin/bash
26 26

  
27 27
=head1 ENVIRONMENT VARIABLES
28
 
28

  
29 29
  None
30 30

  
31 31
=head1 AUTHOR
......
66 66
    SunOS)
67 67
        case $osver in
68 68
        illumos*)
69
            osname=illumos 
69
            osname=illumos
70 70
        ;;
71 71
        esac
72 72
    ;;
......
84 84
    case $func in
85 85
    size)
86 86
        global_attr="
87
            graph_title ZFS ARC - Size 
87
            graph_title ZFS ARC - Size
88 88
            graph_category fs
89 89
            graph_args --base 1024 --lower-limit 0
90 90
            graph_vlabel Bytes
......
150 150
        "
151 151
        data_attr="
152 152
            mfu_ghost_hits DERIVE LINE dummy
153
            mfu_hits       DERIVE LINE MFU 
153
            mfu_hits       DERIVE LINE MFU
154 154
            mru_ghost_hits DERIVE LINE dummy
155 155
            mru_hits       DERIVE LINE MRU
156 156
        "
......
219 219
        echo "Unknown function: $func"
220 220
        exit 1
221 221
        ;;
222
    esac 
222
    esac
223 223
}
224 224

  
225 225
do_config() {
226 226
    local func=$1
227
    local label_max_length=45 
227
    local label_max_length=45
228 228
    local field type draw label
229 229

  
230 230
    preconfig "$func"
......
254 254

  
255 255
get_stats() {
256 256
    local arcstats stat value
257
    
257

  
258 258
    case $osname in
259 259
    SunOS|illumos)
260 260
        arcstats=$( kstat -p 'zfs:0:arcstats' | sed -e 's/:/ /g' | awk '{ print $4,$5 }' )
......
286 286
    esac
287 287

  
288 288
    while read -r stat value
289
    do 
290
        printf -v "arcstats_${stat}" "%s" "$value" 
289
    do
290
        printf -v "arcstats_${stat}" "%s" "$value"
291 291
        # printf -v means indirect variable assignment (similar to eval)
292 292
    done <<< "$arcstats"
293 293
}
......
303 303
    do
304 304
        [ -z "$field" ] && continue
305 305

  
306
        ref="arcstats_${field}" 
307
        value=${!ref:-0} 
306
        ref="arcstats_${field}"
307
        value=${!ref:-0}
308 308
        # ${!varname} means indirect evaluation (similar to eval)
309 309

  
310 310
        echo "${field}.value ${value}"

Formats disponibles : Unified diff