DOKK / manpages / debian 11 / nbdkit / nbdkit-stats-filter.1.en
nbdkit-stats-filter(1) NBDKIT nbdkit-stats-filter(1)

nbdkit-stats-filter - display statistics about operations

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

"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.

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

The file where we write the stats.

This parameter is required.

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

$filterdir/nbdkit-stats-filter.so
The filter.

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

"nbdkit-stats-filter" first appeared in nbdkit 1.14.

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

Richard W.M. Jones

Copyright (C) 2019 Red Hat Inc.

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

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.

2021-01-20 nbdkit-1.24.1