Go to main content

man pages section 7: Standards, Environments, Macros, Character Sets, and Miscellany

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

ssid-op (7)

Name

ssid-op, ssid-fmt - Statistics Store Operations and Formats

Description

The Oracle Solaris Statistics Store uses statistics store identifiers (SSIDs) to name statistics and events. For more information, see the ssid(7) man page. An SSID can also include an operator (//:op) to apply various mathematical and statistical operations to statistics. An SSID can also specify a format (//:fmt) for the event information.

The set of op and fmt arguments is pre-defined. The available operations for a statistic or event are constrained by its type.

You can query the metadata about an operation by using the info subcommand of sstore on the full SSID including the operation. For more information, see the sstore(1) man page.

You can also combine operations. For more information, see Example 9 in the "Examples" section.

When defining a statistic, see the ssid-metadata(7) man page to provide the metadata used by these operations.

The list of sstore operations and formats with their descriptions:

    op.min(Optional percentage)
    op.max(Optional percentage)
    op.avg(Optional agg)
    op.difference
    op.quotient
    op.sum
    op.product
    op.rate
    op.delta
    op.util
    op.convert (Required unit)
    op.filter (Required value)
    op.changed
    op.count
    op.top (Optional Limit, Optional Metric)
    fmt.summary
    fmt.action
    fmt.impact
    fmt.response
    fmt.description
    fmt.label
    fmt.raw

Operations

op.min(Optional percentage)
op.max(Optional percentage)

min and max search for extrema within the specified SSID's data points over a given time range. These operations also can take an optional percentage argument.

min and max gives data points in the following range:

  • min - [min + (max-min) * pct / 100] for op.min(pct)

  • max - [min + (max-min) * pct / 100] for op.max(pct)

For more information, see Example 1.

op.avg (Optional agg)
op.difference
op.product
op.quotient
op.sum

avg, difference, product, quotient, and sum provide arithmetic operations across different SSIDs by matching time stamps in those SSIDs and calculating values correspondingly. When using wildcards or multiple SSIDs, these operations merge the result into the first SSID as shown in Example 2.

avg man also take an optional aggregation argument, agg. This optional field may be set to agg=all or agg=time. If agg is specified, avg calculates the average of all data points across all provided SSIDs or one SSID respectively. Time stamps are not matched across SSIDs. For more information, see Example 3.

op.filter (Required value)

filter returns only data points that explicitly match the supplied argument as shown in Example 4.

op.rate
op.delta

rate and delta on an SSID is obtained by calculating the change or rate of change between two consecutive data points of the SSID. Given two points with values value1 at timestamp time1 and value2 at timestamp time2, then data points are computed as follows:

(value2-value1)/(time2-time1) for op.rate
(value2-value1) for op.delta

This will be calculated for all the data points in an SSID as seen in Example 5.

//:op.rate and //:op.delta need at least two data points in order to complete the calculation referenced above. If only one data point exists, these operations will return NO_DATA. For historical queries, these operations attempt to grab an extra data point from a timestamp prior to the user specified time range. In case of events, this extra point may not exist, then these operations will skip the first NO_DATA that would occur while calculating the change between the first value of the user's query and the non-existent value of the unspecified timestamp.

op.util

utilization is calculated differently depending on whether you have specified a partition or not. For partition stats, the operation calculates the total of all (key, value) pairs within the partition. Each value is then replaced with its percentage of the total. For more information, see Example 6.

When you apply the util to an SSID that is not a partition, the metadata is searched to determine whether the SSID has a known capacity. When found, values of the SSID are calculated as a percentage of that capacity.

op.convert (Required unit)

Converts the statistic values to desired units. The user must specify the required unit in the argument section of the operation. The various unit types supported by sstore are below. They adhere to IEEE standard - https://en.wikipedia.org/wiki/IEEE_1541-2002.

  • Speed/ Size: bits, kilobits, megabits, gigabits, terabits, petabits, exabits, bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, kibibits, mebibits, gibibits, tebibits, pebibits, exbibits, kibibytes, mebibytes, gibibytes, tebibytes, pebibytes, exbibytes, pages

  • Time: nanoseconds, microseconds, milliseconds, seconds, minutes, hours, days, weeks, years

  • Temperature: Celsius, Fahrenheit

When using op.convert, providing an invalid argument type for the stat results in a failure. For example, using op.convert(minutes) on a stat which has units=bytes. For more information about the usage of //:op.convert, see Example 7.

op.changed

Provides the timestamps and values of non-event statistic changes.

op.top

Sorts the output by value, and then limits the output to the top elements. This operation does no filtering of the data associated with a given SSID, but instead removes less interesting SSIDs from the returned result. With no arguments specified, //:op.top will leave a maximum of 5 SSIDs in the return result, and is equivalent to //:op.top(5). Most queries will have multiple historical values associated with a given SSID. By default //:op.top weights the values by taking their average, and then compares these averages when sorting each SSID. This can be modified by using the optional metric argument. Metric can take the value of 'max' or 'variance' to weight a data set by its largest value or its variance respectively. //op.top also has the side effect of filtering out all SSIDs that contain no data over the requested range.

When used with partitioned SSIDs, this operation only works on a single partition at a time, and filters out partition keys. Partitioned SSIDs are ignored if lumped in a query containing non-partitioned SSIDs.

op.count

Provides a count of the number of ssid's in the query. This operator is valid for both numeric, string and event-type statistics.

Formats

fmt.label

The fmt.label format shows the label of an event in the value column of the output.

fmt.description

The fmt.description format shows the description of the event in the value column of the output.

fmt.summary

The fmt.summary format shows both the label and description of the event.

fmt.raw

If you do not specify any formatting, or if you specify fmt.raw, the output is shown as a list of name-value pairs. For more information on how to format event data, see Example 8.

Examples

Example 1 Exporting Statistics With op.min or op.max (agg)

The following example exports statistics with op.min or op.max (agg).

$ sstore export -t 2016-03-10T13:18:34 -e 2016-03-10T13:18:38 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate
 TIME                VALUE IDENTIFIER
 2016-03-10T13:18:35 9202.092374581405 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate
 2016-03-10T13:18:36 8065.265410471358 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate
 2016-03-10T13:18:37 59.94155698194261 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate
 2016-03-10T13:18:38 8758.661754010182 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate

$ sstore export -t 2016-03-10T13:18:34 -e 2016-03-10T13:18:38 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.min
  TIME                VALUE IDENTIFIER
  2016-03-10T13:18:37 59.94155698194261 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.min

$ sstore export -t 2016-03-10T13:18:34 -e 2016-03-10T13:18:38 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.max(10)
  TIME                VALUE IDENTIFIER
  2016-03-10T13:18:35 9202.092374581405 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.max(10)
  2016-03-10T13:18:36 8065.265410471358 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.max(10)
  2016-03-10T13:18:38 8758.661754010182 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.max(10)
Example 2 Exporting Statistics With op.sum

The following example exports statistics with op.sum.

$ sstore export -t 2016-03-10T23:03:40 -p 1 //:class.cpu//:res.id/*//:stat.interrupt-count
 TIME                VALUE IDENTIFIER
 2016-03-10T23:03:40 56409717.0 //:class.cpu//:res.id/0//:stat.interrupt-count
 2016-03-10T23:03:40 35839679.0 //:class.cpu//:res.id/1//:stat.interrupt-count
 2016-03-10T23:03:40 35913257.0 //:class.cpu//:res.id/2//:stat.interrupt-count
 2016-03-10T23:03:40 177732121.0 //:class.cpu//:res.id/3//:stat.interrupt-count

$ sstore export -t 2016-03-10T23:03:40 -p 1 //:class.cpu//:res.id///:s.[0,2]//:stat.interrupt-count//:op.sum
  TIME                VALUE IDENTIFIER
  2016-03-10T23:03:40 92322974.0 //:class.cpu//:res.id/0//:stat.interrupt-count//:op.sum
Example 3 Exporting Statistics With op.avg or op.avg (agg)

This shows the average rate of out-bytes and in-bytes for net0 for each time stamp and saves the result in out-bytes statistics.

$ sstore export -t 2016-03-10T13:18:34 -e 2016-03-10T13:18:38 //:class.link/phys//:res.name/net0//:stat.*bytes//:op.rate//:op.avg
  TIME                VALUE IDENTIFIER
  2016-03-10T13:18:35 8778.502409667442 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.avg
  2016-03-10T13:18:36 5069.138695990545 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.avg
  2016-03-10T13:18:37 29.970778490971306 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.avg
  2016-03-10T13:18:38 5457.80417042975 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.avg

This shows the average rate of out-bytes over a specified period and average rate of in-bytes over the same specified period separately.

$ sstore export -t 2016-03-10T13:18:34 -e 2016-03-10T13:18:38 //:class.link/phys//:res.name/net0//:stat.*bytes//:op.rate//:op.avg(agg=time)
  TIME                VALUE IDENTIFIER
  2016-03-10T13:18:38 3146.217753278132 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.avg(agg=time)
  2016-03-10T13:18:38 6521.490274011223 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.avg(agg=time)

This shows the average rate of out-bytes and in-bytes over a specified period and saves the result in out-bytes statistics.

$ sstore export -t 2016-03-10T13:18:34 -e 2016-03-10T13:18:38 //:class.link/phys//:res.name/net0//:stat.*bytes//:op.rate//:op.avg(agg=all)
  TIME                VALUE IDENTIFIER
  2016-03-10T13:18:38 4833.854013644677 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.avg(agg=all)
Example 4 Exporting Statistics With op.filter (0)

The following example exports statistics with op.filter (0).

$ sstore export -t 2016-03-11T08:30:10 -e 2016-03-11T08:30:45 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.filter(0)
 TIME                VALUE IDENTIFIER
 2016-03-11T08:30:11 0.0 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.filter(0)
 2016-03-11T08:30:29 0.0 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.filter(0)
 2016-03-11T08:30:45 0.0 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.filter(0)
Example 5 Exporting in-bytes Statistics For net0 Resource With op.delta or op.rate

The following example exports in-bytes statistics for net0 resource with op.delta or op.rate.

$ sstore export -t 2016-03-11T08:30:10 -e 2016-03-11T08:30:13 //:class.link/phys//:res.name/net0//:stat.in-bytes
  TIME                VALUE IDENTIFIER
  2016-03-11T08:30:10 217758030 //:class.link/phys//:res.name/net0//:stat.in-bytes
  2016-03-11T08:30:11 217758030 //:class.link/phys//:res.name/net0//:stat.in-bytes
  2016-03-11T08:30:12 217758090 //:class.link/phys//:res.name/net0//:stat.in-bytes
  2016-03-11T08:30:13 217758604 //:class.link/phys//:res.name/net0//:stat.in-bytes
$ sstore export -t 2016-03-11T08:30:10 -e 2016-03-11T08:30:13 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.delta
  TIME                VALUE IDENTIFIER
  2016-03-11T08:30:11 0.0 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.delta
  2016-03-11T08:30:12 60.0 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.delta
  2016-03-11T08:30:13 514.0 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.delta

$ sstore export -t 2016-03-11T08:30:10 -e 2016-03-11T08:30:13 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate
  TIME                VALUE IDENTIFIER
  2016-03-11T08:30:11 0.0 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate
  2016-03-11T08:30:12 59.024095603295116 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate
  2016-03-11T08:30:13 521.6129408720273 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate
Example 6 Exporting in-bytes Statistics For net0 Resource With op.util

The following example exports in-bytes statistics for net0 resource with op.util.

$ sstore export -t 2016-03-09T16:32:32 -p 1 //:class.cpu//:stat.usage//:part.mode
  TIME                VALUE IDENTIFIER
  2016-03-09T16:32:56  //:class.cpu//:stat.usage//:part.mode
                      stolen: 0.0
                      intr: 495808.247348
                      idle: 76499305.003489
                      user: 1872796.029831
                      kernel: 1417289.148075
$ sstore export -t 2016-03-09T16:32:32 -p 1 //:class.cpu//:stat.usage//:part.mode//:op.util\fR
  TIME                VALUE IDENTIFIER
  2016-03-09T16:32:56  //:class.cpu//:stat.usage//:part.mode//:op.util
                      stolen: 0.0
                      intr: 0.6175587244615878
                      idle: 95.28444408266094
                      user: 2.332679082176271
                      kernel: 1.7653181107012057
Example 7 Exporting unique data points using an operator

The following example exports pkg-version in class.system using op.changed.

$ sstore export//:class.system//:stat.pkg-version//:op.changed
  TIME                VALUE IDENTIFIER
  2017-05-03T00:12:48 5.12,5.12-5.12.0.0.0.122.0 //:class.system//:stat.pkg-version//:op.changed
  2017-06-11T22:01:29 5.12,5.12-5.12.0.0.0.125.0 //:class.system//:stat.pkg-version//:op.changed
  2017-08-15T12:57:53 11.4,5.11-11.4.0.0.0.2.0 //:class.system//:stat.pkg-version//:op.changed
  2017-08-23T18:10:44 NO_DATA //:class.system//:stat.pkg-version//:op.changed
  2017-08-23T18:10:45 11.4,5.11-11.4.0.0.0.2.0 //:class.system//:stat.pkg-version//:op.changed
  2017-10-20T16:37:06 NO_DATA //:class.system//:stat.pkg-version//:op.changed
  2017-10-20T16:37:07 11.4,5.11-11.4.0.0.0.6.0 //:class.system//:stat.pkg-version//:op.changed
  2017-10-20T16:51:49 NO_DATA //:class.system//:stat.pkg-version//:op.changed
  2017-10-20T16:51:50 11.4,5.11-11.4.0.0.0.6.0 //:class.system//:stat.pkg-version//:op.changed

The NO_DATA points are reported because they, too, are changes from the previously-recorded value. In this particular case, they reflect the fact that the statistic was only captured intermittently.

Example 8 Counting event instances

The following example exports counts of various event and statistic SSIDs using op.count:

$ sstore export  "//:class.svc//:res.fmri/system/name-service/cache:default//:event.adm-action//:op.filter(event=AUE_)//:op.count"

  TIME                VALUE IDENTIFIER
  2016-05-11T16:34:20 20    //:class.svc//:res.fmri/system/name-service/cache:default//:event.adm-action//:op.filter(event=AUE_)//:op.count

  $ sstore export  "//:class.event//:event.adm-action//:op.filter(return/errval=failure,event=AUE_login)//:op.count"
  TIME                VALUE IDENTIFIER
  2016-05-06T11:57:09 7     //:class.event//:event.adm-action//:op.filter(return/errval=failure,event=AUE_login)//:op.count

  $ sstore export //:class.system//:stat.//:s.[nodename,physical-memory,product,serial]//:op.count
  TIME                VALUE IDENTIFIER
  2016-08-26T11:09:25 69519 //:class.system//:stat.nodename//:op.count
  2016-09-13T15:43:42 43532 //:class.system//:stat.physical-memory//:op.count
  2016-08-26T11:09:25 69767 //:class.system//:stat.product//:op.count
  2016-08-26T11:09:25 69324 //:class.system//:stat.serial//:op.count
      
Example 9 Applying op.convert on Various SSIDs

The following example applies op.convert on various SSIDs.

The out-bytes statistics of resource net0 is converted to kilobytes.

$ sstore info //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.convert(kilobytes)
Identifier: //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.convert(kilobytes)
   $schema: //:stat
 copyright: Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
   description: total bytes transmitted
   id: //:class.link/phys//:stat.out-bytes
   max-rate: //:stat.ifspeed
   stability: stable
   type: counter
   units: kilobytes

The out-bytes statistics of resource net0 is converted to gigabytes or minutes, and gibibytes or minutes.

$ sstore capture //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate
  TIME            VALUE           IDENTIFIER
  2016-03-24T11:23:13 329.9340131973605 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate
  2016-03-24T11:23:14 1013.7881182832789 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate
$ sstore capture //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.convert(gigabytes/minutes)
  TIME                VALUE IDENTIFIER
  2016-03-24T11:13:11 1.2838793153443577e-05 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.convert(gigabytes/minutes)
  2016-03-24T11:13:12 3.9598653645776044e-05 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.convert(gigabytes/minutes)
$ sstore capture //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.convert(gibibytes/minutes)
  TIME                VALUE IDENTIFIER
  2016-03-24T11:13:22 1.8422611805723817e-05 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.convert(gibibytes/minutes)
  2016-03-24T11:13:23 4.2599657979073085e-05 //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.rate//:op.convert(gibibytes/minutes)

When the wrong convert type is applied on statistic with units=bytes:

$ sstore capture //:class.link/phys//:res.name/net0//:stat.out-bytes//:op.convert(seconds)
  TIME                VALUE IDENTIFIER
  Warning (//:class.link/phys//:res.name/net0//:stat.out-bytes//:op.convert(seconds)) - Cannot perform op.convert as metadata unit 'bytes'
  can not be converted to desired unit 'seconds'
Example 10 Exporting formatted events

When the svc:/network/smtp:sendmail service is enabled, sstore allows to format this event data as below.

$ store export //:class.svc//:res.fmri/network/smtp:sendmail//:event.adm-action//:fmt.label
 TIME                VALUE IDENTIFIER
 2015-08-30T00:31:14 ('AUE_smf_enable',) //:class.svc//:res.fmri/network/smtp:sendmail//:event.adm-action//:fmt.label
 $ sstore export //:class.svc//:res.fmri/network/smtp:sendmail//:event.adm-action//:fmt.description
   TIME                   VALUE IDENTIFIER
   2015-08-30T00:31:14    ('header, 177, 2, persistently enable service instance, , sy
   stem1,2015-08-30 00:31:14.027-07:00, subject, usr1, root, root, root, root, 158
   706, 4293668494, 58180 22 dhcp.vpn.example.com, use of authorization, solaris.sm
   f.modify, fmri, svc:/network/smtp:sendmail/:properties/general/enabled, return,
   success, 0\n',) //:class.svc//:res.fmri/network/smtp:sendmail//:event.adm-action
   //:fmt.description
$ sstore export //:class.svc//:res.fmri/network/smtp:sendmail//:event.adm-action//:fmt.summary
  TIME                    VALUE IDENTIFIER
  2015-08-30T00:31:14  //:class.svc//:res.fmri/network/smtp:sendmail//:event.adm-action//:fmt.summary
                                0:
                                    ts: 1440919874027218
                           label: AUE_smf_enable
                                    description: header, 177, 2, persistently enable service
             instance, , system1, 2015-08-30 00:31:14.027-07:00, subject, usr1, root, root,
             root, root, 158706, 4293668494, 58180 22 dhcp.vpn.example.com, use of authorizat
             ion, solaris.smf.modify, fmri, svc:/network/smtp:sendmail/:properties/general/en
             abled, return, success, 0
$ sstore export //:class.svc//:res.fmri/network/smtp:sendmail//:event.adm-action//:fmt.raw
   TIME                VALUE IDENTIFIER
   2015-08-30T00:31:14  //:class.svc//:res.fmri/network/smtp:sendmail//:event.adm-action//:fmt.raw
                        0:
                           version: 2
                           event: AUE_smf_enable
                           host: system1
                           iso8601: 2015-08-30 00:31:14.027-07:00
                           subject/audit-uid: usr1
                           subject/uid: root
                           subject/gid: root
                           subject/ruid: root
                           subject/rgid: root
                           subject/pid: 158706
                           subject/sid: 4293668494
                           subject/tid: 58180 22 dhcp.vpn.example.com
                           use_of_authorization/value: solaris.smf.modify
                           fmri/value: svc:/network/smtp:sendmail/:properties/general/enable
Example 11 Combining Operations

Operations can be combined as follows:

$ sstore capture //:class.cpu//:res.id/*//:stat.usage//:part.mode//:op.sum//:op.rate//:op.util

  TIME                VALUE IDENTIFIER
  2015-02-19T09:55:17  //:class.cpu//:res.id/0//:stat.usage//:part.mode//:op.sum//:op.rate//:op.util
                      kernel: 0.300850394534
                      idle: 99.0696367035
                      stolen: 0.386165574037
                      user: 0.058161992642
                      intr: 0.185185335255
$ sstore export -t 2016-04-01T12:52:55 -e 2016-04-01T12:52:57 //:class.link/phys//:res.name/net0//:stat.in-bytes\
  TIME                VALUE IDENTIFIER
  2016-04-01T12:52:55 72684860 //:class.link/phys//:res.name/net0//:stat.in-bytes
  2016-04-01T12:52:56 72685388 //:class.link/phys//:res.name/net0//:stat.in-bytes
  2016-04-01T12:52:57 72685556 //:class.link/phys//:res.name/net0//:stat.in-bytes

$ sstore export -t 2016-04-01T12:52:55 -e 2016-04-01T12:52:57 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.convert(gigabytes/minutes)
  TIME                VALUE IDENTIFIER
  2016-04-01T12:52:56 3.167892291662084e-05 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.convert(gigabytes/minutes)
  2016-04-01T12:52:57 1.0062812715881275e-05 //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.convert(gigabytes/minutes)
                      

See Also

sstore(1), ssid(7), ssid-metadata(7), sstore(7), sstored(8)

Using Oracle Solaris 11.4 StatsStore and System Web Interface