The Otter rules engine provides a number of metrics to evaluate the performance of your rules:
The marks names are formatted as following:
Example :<rule-engine-name>:<ruleset-name>:<rule-name>:start
<rule-engine-name>:<ruleset-name>:<rule-name>:end
[!NOTE] The
<rule engine name>
is the name of the rules engine instance. Its default value isrules-engine
. This can be overridden via therulesEngineInstanceName
option during the rules engine's instantiation.
If the rules engine is running in a browser, the performance metrics can be analyzed via the built-in Performance API.
If the rules engine is running in a Node, there is no default performance reporting mechanism.
The reporting of the performance metrics can be configured via the rules engine performance
option.
The following example shows how to configure the reporting of the performance metrics in a Node application context:
import { RulesEngine, EngineDebugger } from '@o3r/rules-engine';
import { performance } from 'node:perf_hooks';
const engine = new RuleEngine({ performance });