Skip to content
Metrics

Metrics

The Metric and MetricInfo classes provide standard data structures used by the framework to store runtime execution metrics, system limit checks, and calculation parameters.


Metric

The Metric class represents an individual logged metric record containing execution details, system limit values, and class context.

Properties

  • name: The name identifier of the metric (String).
  • value: The recorded value or state of the metric (Decimal / Object).
  • limitValue: The system or defined limit value for the metric (Decimal / Object).
  • logTime: Timestamp indicating when the metric was logged (Datetime).
  • className: The Apex class name where the metric was evaluated (String).

Signature:

public class Metric {
    public String name;
    public Object value;
    public Object limitValue;
    public Datetime logTime;
    public String className;
}

MetricInfo

The MetricInfo class holds configuration and operational metadata required to compute and evaluate metric thresholds.

Properties

  • name: The name identifier of the metric (String).
  • calculationType: The calculation mechanism or algorithm type used (String).
  • parameters: Map of parameters used during calculation (Map<String, Object>).
  • limitValue: The maximum defined limit value for the metric (Decimal / Object).
  • warningThreshold: The threshold value that triggers a warning state (Decimal / Object).
  • errorThreshold: The threshold value that triggers an error state (Decimal / Object).

Signature:

public class MetricInfo {
    public String name;
    public String calculationType;
    public Map<String, Object> parameters;
    public Object limitValue;
    public Object warningThreshold;
    public Object errorThreshold;
}