Unit Conversion

The unit conversion operation supports conversion for size, time, and temperature statistics. The statistics can be scalar, counter, or rate types. The following table lists the keywords that can be used as arguments of the convert operation.

Table 4-1 Keywords Supported for the convert Operation

Unit Type Keywords Keywords Keywords Keywords

Size

Powers of 1000 bits:

  • bits

  • kilobits

  • megabits

  • gigabits

  • terabits

  • petabits

  • exabits

Powers of 1000 bytes:

  • bytes

  • kilobytes

  • megabytes

  • gigabytes

  • terabytes

  • petabytes

  • exabytes

Powers of 1024 bits:

  • kibibits

  • mebibits

  • gibibits

  • tebibits

  • pebibits

  • exbibits

Powers of 1024 bytes:

  • kibibytes

  • mebibytes

  • gibibytes

  • tebibytes

  • pebibytes

  • exbibytes

Pages: pages

Time

  • nanoseconds

  • microseconds

  • milliseconds

  • seconds

  • minutes

  • hours

  • days

  • weeks

  • years

Temperature

Celsius

Fahrenheit

You can use the sstore info command on a statistic to determine the type of the statistic. For example, memory statistics are in bytes and could be converted to a different size unit.

$ sstore info //:class.system//:stat.total-memory
  Identifier: //:class.system//:stat.total-memory
     $schema: //:stat
   copyright: Copyright (c) 2014, 2016, Oracle and/or its affiliates.
 description: Total system memory
          id: //:class.system//:stat.total-memory
    localize: description
max-capacity: //:stat.total-memory
   stability: stable
        type: scalar
       units: bytes

The following command records available memory in kilobytes:

$ sstore capture //:class.system//:stat.available-memory//:op.convert(kilobytes)

The rate at which bytes are transmitted and received is bytes per second.

$ sstore info //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate
 Identifier: //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate
    $schema: //:stat
  copyright: Copyright (c) 2014, 2016, Oracle and/or its affiliates.
description: bytes received
         id: //:class.link/phys//:stat.in-bytes
   localize: description
   max-rate: //:stat.speed
  stability: stable
      units: bytes/seconds
       type: rate

The following command records the rate at which bytes are received as kilobytes per minute:

$ sstore capture \
> //:class.link/phys//:res.name/net0//:stat.in-bytes//:op.rate//:op.convert(kilobytes/minutes)