This is an old revision of the document!


Data Types

The following datatypes are used by the OpenTrafficShaper API.

See below example of the JSON format for this type.

  1. $identifier can be one of the following
    1. 'tx.cir', 'tx.limit', 'tx.rate', 'tx.pps', 'rx.cir', 'rx.limit', 'rx.pps', $counter
    2. $counter is a basic counter name
  2. $label is a text label for this entry, like "RX Limit"
  3. $timestamp is the timestamp of this $value
  4. $value holds the value of the data

It must be noted there may be multiple identifiers and multiple timestamp/value pairs.

{
  $identifier: {
    label: $label,
    data: [
      [$timestamp, $value],
      ...
    ]
  },
  ...
}

See below example of the JSON format for this type. This type builds on the OTSJsonStats above by allowing tagging of stats to accomplish streaming of multiple items at unknown time intervals.

All definitions hold true as with OTSJsonStats, with the addition of the following…

  1. $tag is the tag given to the statistical item reported during the subscription process

It must be noted there may be multiple tags depending on what data is subscribed to.

{
  $tag: {
    $identifier: {
      label: $label,
      data: [
        [$timestamp, $value],
        ...
      ]
    },
    ...
   },
   ...
}