The metrics action is used to display performance metrics for each subsequent action executed within the CAS session. When enabled, it provides a brief set of key metrics after an action completes, which is useful for performance monitoring and debugging.
| Parameter | Description |
|---|---|
| on | Specifies whether to display a brief set of action metrics after each action executes. When set to TRUE, metrics are enabled. When set to FALSE, they are disabled. |
The `session.metrics` action itself does not require a data table. However, to see its effect, you must run at least one other CAS action after enabling metrics. The following code runs the `serverStatus` action, which will generate metrics that can be observed.
| 1 | PROC CAS; |
| 2 | BUILTINS.serverStatus; |
| 3 | RUN; |
This example demonstrates how to enable the display of performance metrics for all subsequent actions in the current session.
| 1 | PROC CAS; |
| 2 | SESSION.metrics / on=TRUE; |
| 3 | RUN; |
This example first enables metrics. It then runs the `listNodes` action. The log output for the `listNodes` action will be followed by a NOTE containing its performance metrics.
| 1 | PROC CAS; |
| 2 | SESSION.metrics / on=TRUE; |
| 3 | BUILTINS.listNodes; |
| 4 | RUN; |
| 5 | |
| 6 | /* Disable metrics after use */ |
| 7 | PROC CAS; |
| 8 | SESSION.metrics / on=FALSE; |
| 9 | RUN; |