From 7ea810fefd3d911625dc47f409893f6e8002662b Mon Sep 17 00:00:00 2001 From: pjd Date: Thu, 8 Dec 2005 23:00:31 +0000 Subject: Teach NOP GEOM class how to gather the following statistics: - number of read I/O requests, - number of write I/O requests, - number of read bytes, - number of written bytes. Add 'reset' subcommand for resetting statistics. --- sbin/geom/class/nop/geom_nop.c | 3 +++ sbin/geom/class/nop/gnop.8 | 28 ++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) (limited to 'sbin/geom') diff --git a/sbin/geom/class/nop/geom_nop.c b/sbin/geom/class/nop/geom_nop.c index cf72f54..054d52d 100644 --- a/sbin/geom/class/nop/geom_nop.c +++ b/sbin/geom/class/nop/geom_nop.c @@ -68,5 +68,8 @@ struct g_command class_commands[] = { }, "[-fv] prov ..." }, + { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] prov ..." + }, G_CMD_SENTINEL }; diff --git a/sbin/geom/class/nop/gnop.8 b/sbin/geom/class/nop/gnop.8 index 2663508..64c04ca 100644 --- a/sbin/geom/class/nop/gnop.8 +++ b/sbin/geom/class/nop/gnop.8 @@ -49,6 +49,10 @@ .Op Fl fv .Ar prov ... .Nm +.Cm reset +.Op Fl v +.Ar prov ... +.Nm .Cm list .Nm .Cm status @@ -62,7 +66,10 @@ The utility is used for setting up transparent providers on existing ones. Its main purpose is testing other GEOM classes, as it allows forced provider removal and I/O error simulation with a given probability. -It is also a good starting point for implementing new GEOM classes. +It also gathers the following statistics: number of read requests, number of +write requests, number of read bytes and number of wrote bytes. +In addition, it can be used as a good starting point for implementing new GEOM +class. .Pp The first argument to .Nm @@ -77,13 +84,11 @@ The kernel module will be loaded if it is not loaded already. .It Cm configure Configure existing transparent provider. -At the moment it is only used -for changing failure probability. -The kernel module -.Pa geom_nop.ko -will be loaded if it is not loaded already. +At the moment it is only used for changing failure probability. .It Cm destroy Turn off the given transparent providers. +.It Cm reset +Reset statistics for the given transparent providers. .It Cm list See .Xr geom 8 . @@ -139,6 +144,17 @@ with 50% failure probability, and how to destroy it. gnop create -v -f 50 da0 gnop destroy -v da0.nop .Ed +.Pp +The traffic statistics for the given transparent providers we can get with +.Cm list +command. +Example below shows how can we obtain number of bytes written with +.Xr newfs 8 : +.Bd -literal -offset indent +gnop create da0 +newfs /dev/da0.nop +gnop list +.Ed .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 -- cgit v1.1