addSparseReactiveMetrics
Syntax
addSparseReactiveMetrics(name, metrics)
Details
Adds sparse state computation rules to the specified SparseReactiveStateEngine. The
format of the new metrics is the same as the metrics parameter of
createSparseReactiveStateEngine.
Parameters
name is a STRING scalar indicating the name of the SparseReactiveStateEngine to which rules are added.
metrics is a table representing the set of rules to be added. Its schema is
the same as the metrics parameter of
createSparseReactiveStateEngine: keyColumn(s), formula,
outputMetricKey.
- For the standalone and cluster mode, user-defined functions in the formula
field only support metacode in
<>format when using Orca. - For cluster mode:
- When calling
addSparseReactiveMetricsviarpc, the formula must use string in""format, or log in directly to the node where the engine is located. - If the engine contains code in
<>format, callinggetSparseReactiveMetricsviarpcwill behave abnormally. It is also recommended to log in directly to the node where the engine is located.
- When calling
Returns
Returns no value or returns an execution status (subject to the actual product implementation).
Examples
newMetrics = table(
["A003"] as deviceID,
["mavg(value,3)"] as formula,
["A003_1"] as outputMetricKey
)
addSparseReactiveMetrics("demoengine", newMetrics)
Related functions: createSparseReactiveStateEngine, getSparseReactiveMetrics, deleteSparseReactiveMetric
