Table of ContentsView in Frames

Using the stats command interactively in singleton mode

Using the stats command in singleton mode enables you to see a set of information about the system's current state at the command line.

Step

  1. Enter the following command:
    stats show [-e] object_def [object_def...]

    object_def is one of the following values:

    • An object name (object_name); for example, stats show system.

      This returns statistics from all counters provided for all instances of the specified object.

    • The name of a specific instance (object_name:instance_name); for example, stats show processor:processor0.

      This returns statistics from all counters provided for the specified instance of the specified object.

    • The name of a specific counter (object_name:instance_name:counter_name); for example, stats show system:*:net_data_recv.
      Note: To see the statistic for all instances of the object, use an asterisk (*) for the instance name.

      To specify an instance name that includes spaces, enclose the name in double quotes ("name with spaces").

      To specify an instance name that contains a colon (:), repeat the colon (disk:20::00::00::20::37::de::4a::8e).

    • An asterisk (*)

      This returns statistics for all instances of all objects.

    The -e option allows extended regular expressions (regex) for instance and counter names. With the -e option, the instance and counter names are independently interpreted as regular expressions. The asterisk (*) character is still a wildcard representing all instances or counter names. The regular expression is not anchored. You can use ^ to indicate the start of an instance or counter name, and $ to indicate the end of an instance or counter name.

Examples of stats show command in singleton mode

The following command shows all current statistics for a volume named myvol.

toaster> stats show volume:myvol
volume:myvol:total_ops:132/s
volume:myvol:avg_latency:13ms
volume:myvol:read_ops:5/s
volume:myvol:read_data:1923b/s
volume:myvol:read_latency:23ms
volume:myvol:write_ops:186/s
volume:myvol:write_data:1876b/s
volume:myvol:write_latency:6ms
volume:myvol:other_ops:0/s
volume:myvol:other_latency:0ms

The following command returns any counters in the system object ending in "latency".

toaster> stats show -e system::latency$
system:system:sys_read_latency:0ms
system:system:sys_write_latency:0ms
system:system:sys_avg_latency:0ms