nbdkit-stats-filter - Man Page

display statistics about operations

Synopsis

 nbdkit --filter=stats PLUGIN statsfile=FILE [statsappend=true]

Description

nbdkit-stats-filter is a filter that displays statistics about NBD operations, such as the number of bytes read and written.  Statistics are written to a file once when nbdkit exits.

Example

In this example we run guestfish(1) over nbdkit to create an ext4 filesystem on a RAM disk, and use the stats filter to display the number of read, write and trim operations involved:

 $ nbdkit -U - --filter=stats memory 1G statsfile=/dev/stderr \
          --run '
       guestfish add-drive "" protocol:nbd server:unix:$unixsocket \
                              discard:enable format:raw : \
                 run : \
                 mkfs ext4 /dev/sda
 '
 total: 370 ops, 1.282993 s, 1.04 GiB, 827.29 MiB/s
 read: 250 ops, 0.000364 s, 4.76 MiB, 12.78 GiB/s op, 3.71 MiB/s total
 write: 78 ops, 0.175715 s, 32.64 MiB, 185.78 MiB/s op, 25.44 MiB/s total
 trim: 33 ops, 0.000252 s, 1.00 GiB, 3968.25 GiB/s op, 798.13 MiB/s total
 flush: 9 ops, 0.000002 s, 0 bytes, 0 bytes/s op, 0 bytes/s total

Parameters

statsfile=FILE

The file where we write the stats.

This parameter is required.

statsappend=true

If set then we append to the file instead of replacing it.

Files

$filterdir/nbdkit-stats-filter.so

The filter.

Use nbdkit --dump-config to find the location of $filterdir.

Version

nbdkit-stats-filter first appeared in nbdkit 1.14.

See Also

nbdkit(1), nbdkit-filter(3), nbdkit-log-filter(1).

Authors

Richard W.M. Jones

License

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Referenced By

nbdkit(1), nbdkit-filter(3), nbdkit-log-filter(1), nbdkit-release-notes-1.14(1).

2020-07-18 nbdkit-1.21.19