Cedarling JavaScript/TypeScript API
    Preparing search index...

    Class MetricsSnapshot

    A WASM wrapper for the Rust cedarling::MetricsSnapshot struct. Represents a snapshot of the collected telemetry metrics for the current interval. Destructive read: taking a snapshot resets the collected metrics, so use a single consumer.

    Index
    error_counters: Map<any, any>

    Classified error counters keyed by error metric key.

    interval_secs: number

    Duration of the snapshot interval in fractional seconds. Exposed as Number (not BigInt) so plain JS arithmetic works.

    operational_stats: Map<any, any>

    Operational counters and gauges (authorization, cache, JWT, data, lock).

    policy_stats: Map<any, any>

    Per-policy evaluation counts (policy_id, policy_id.allow, policy_id.deny).

    • Returns void

    • Returns void

    • Convert MetricsSnapshot to json string value.

      policy_stats, error_counters and operational_stats are converted from Map to plain objects so JSON.stringify emits their entries.

      Returns string