Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To learn more about Simple Metrics, please see the C3.ai Developer Documentation here:

Another type of SimpleMetric is a tsDecl (Timeseries Declaration) metric. tsDecl metrics are often used to turn non-timeseries raw data (e.g., event data, status data, or data with irregular intervals) into timeseries. tsDecl metrics have the same fields as standard SimpleMetric, except for the 'tsDecl' field, which replaces the 'expression' field. tsDecl metrics may allow users the added flexibility to define new metrics which the expression field may not support. Using a tsDecl metric, the above metric can be re-written as:

...

To learn more about tsDecl metrics, please see the C3.ai Developer Documentation here:

Compound Metrics

Compound metrics are generally easier to define and use as they operate on already defined metrics either Simple or Compound. They essentially just consist of and id/name, and an expression defining the metric in terms of constants and already defined metrics. If you try and execute a CompoundMetric on a type for which some necessary SimpleMetric is not defined, you'll get an error.

Essentially, a CompoundMetric defines:

allow C3.ai developers to manipulate or combine existing metrics into more complex timeseries. Compound metrics are built on top of one or many existing Simple or Compound metrics. Please note, to evaluate a Compound metric on a C3.ai Type, all Simple metrics, used in that Compound metric, must be defined on that C3.ai Type, as well. Otherwise, an error is returned.

To declare a compound metric, users should specify the following fields:

  1. 'id': compoun
  2. The name/id of the metric
  3. The expression defining the metric

An example CompoundMetric is:

...