1nbdkit-stats-filter(1) NBDKIT nbdkit-stats-filter(1)
2
3
4
6 nbdkit-stats-filter - display statistics about operations
7
9 nbdkit --filter=stats PLUGIN statsfile=FILE [statsappend=true]
10
12 "nbdkit-stats-filter" is a filter that displays statistics about NBD
13 operations, such as the number of bytes read and written. Statistics
14 are written to a file once when nbdkit exits.
15
17 In this example we run guestfish(1) over nbdkit to create an ext4
18 filesystem on a RAM disk, and use the stats filter to display the
19 number of read, write and trim operations involved:
20
21 $ nbdkit -U - --filter=stats memory 1G statsfile=/dev/stderr \
22 --run '
23 guestfish add-drive "" protocol:nbd server:unix:$unixsocket \
24 discard:enable format:raw : \
25 run : \
26 mkfs ext4 /dev/sda
27 '
28 total: 370 ops, 1.282993 s, 1.04 GiB, 827.29 MiB/s
29 read: 250 ops, 0.000364 s, 4.76 MiB, 12.78 GiB/s op, 3.71 MiB/s total
30 write: 78 ops, 0.175715 s, 32.64 MiB, 185.78 MiB/s op, 25.44 MiB/s total
31 trim: 33 ops, 0.000252 s, 1.00 GiB, 3968.25 GiB/s op, 798.13 MiB/s total
32 flush: 9 ops, 0.000002 s, 0 bytes, 0 bytes/s op, 0 bytes/s total
33
35 statsfile=FILE
36 The file where we write the stats.
37
38 This parameter is required.
39
40 statsappend=true
41 If set then we append to the file instead of replacing it.
42
44 $filterdir/nbdkit-stats-filter.so
45 The filter.
46
47 Use "nbdkit --dump-config" to find the location of $filterdir.
48
50 "nbdkit-stats-filter" first appeared in nbdkit 1.14.
51
53 nbdkit(1), nbdkit-filter(3), nbdkit-log-filter(1).
54
56 Richard W.M. Jones
57
59 Copyright (C) 2019 Red Hat Inc.
60
62 Redistribution and use in source and binary forms, with or without
63 modification, are permitted provided that the following conditions are
64 met:
65
66 · Redistributions of source code must retain the above copyright
67 notice, this list of conditions and the following disclaimer.
68
69 · Redistributions in binary form must reproduce the above copyright
70 notice, this list of conditions and the following disclaimer in the
71 documentation and/or other materials provided with the
72 distribution.
73
74 · Neither the name of Red Hat nor the names of its contributors may
75 be used to endorse or promote products derived from this software
76 without specific prior written permission.
77
78 THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
79 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
80 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
81 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
82 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
83 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
84 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
85 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
86 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
87 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
88 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
89
90
91
92nbdkit-1.24.2 2021-03-02 nbdkit-stats-filter(1)