pub struct MetricsSnapshot {
pub policy_stats: Map,
pub error_counters: Map,
pub operational_stats: Map,
pub interval_secs: f64,
}Expand description
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.
Fields§
§policy_stats: MapPer-policy evaluation counts (policy_id, policy_id.allow, policy_id.deny).
error_counters: MapClassified error counters keyed by error metric key.
operational_stats: MapOperational counters and gauges (authorization, cache, JWT, data, lock).
interval_secs: f64Duration of the snapshot interval in fractional seconds.
Exposed as Number (not BigInt) so plain JS arithmetic works.
Implementations§
Source§impl MetricsSnapshot
impl MetricsSnapshot
Sourcepub fn json_string(&self) -> Result<String, Error>
pub fn json_string(&self) -> Result<String, Error>
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.
Trait Implementations§
Source§impl Clone for MetricsSnapshot
impl Clone for MetricsSnapshot
Source§fn clone(&self) -> MetricsSnapshot
fn clone(&self) -> MetricsSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetricsSnapshot
impl Debug for MetricsSnapshot
Source§impl From<MetricsSnapshot> for JsValue
impl From<MetricsSnapshot> for JsValue
Source§fn from(value: MetricsSnapshot) -> Self
fn from(value: MetricsSnapshot) -> Self
Converts to this type from the input type.
Source§impl From<MetricsSnapshot> for MetricsSnapshot
impl From<MetricsSnapshot> for MetricsSnapshot
Source§impl FromWasmAbi for MetricsSnapshot
impl FromWasmAbi for MetricsSnapshot
Source§impl IntoWasmAbi for MetricsSnapshot
impl IntoWasmAbi for MetricsSnapshot
Source§impl LongRefFromWasmAbi for MetricsSnapshot
impl LongRefFromWasmAbi for MetricsSnapshot
Source§type Abi = WasmPtr<WasmRefCell<MetricsSnapshot>>
type Abi = WasmPtr<WasmRefCell<MetricsSnapshot>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<MetricsSnapshot>
type Anchor = RcRef<MetricsSnapshot>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for MetricsSnapshot
impl OptionFromWasmAbi for MetricsSnapshot
Source§impl OptionIntoWasmAbi for MetricsSnapshot
impl OptionIntoWasmAbi for MetricsSnapshot
Source§impl RefFromWasmAbi for MetricsSnapshot
impl RefFromWasmAbi for MetricsSnapshot
Source§type Abi = WasmPtr<WasmRefCell<MetricsSnapshot>>
type Abi = WasmPtr<WasmRefCell<MetricsSnapshot>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<MetricsSnapshot>
type Anchor = RcRef<MetricsSnapshot>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for MetricsSnapshot
impl RefMutFromWasmAbi for MetricsSnapshot
Source§type Abi = WasmPtr<WasmRefCell<MetricsSnapshot>>
type Abi = WasmPtr<WasmRefCell<MetricsSnapshot>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<MetricsSnapshot>
type Anchor = RcRefMut<MetricsSnapshot>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiimpl SupportsConstructor for MetricsSnapshot
impl SupportsInstanceProperty for MetricsSnapshot
impl SupportsStaticProperty for MetricsSnapshot
Source§impl TryFromJsValue for MetricsSnapshot
impl TryFromJsValue for MetricsSnapshot
Source§impl VectorFromWasmAbi for MetricsSnapshot
impl VectorFromWasmAbi for MetricsSnapshot
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[MetricsSnapshot]>
Source§impl VectorIntoWasmAbi for MetricsSnapshot
impl VectorIntoWasmAbi for MetricsSnapshot
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[MetricsSnapshot]>) -> Self::Abi
Source§impl WasmDescribeVector for MetricsSnapshot
impl WasmDescribeVector for MetricsSnapshot
Auto Trait Implementations§
impl Freeze for MetricsSnapshot
impl RefUnwindSafe for MetricsSnapshot
impl Send for MetricsSnapshot
impl Sync for MetricsSnapshot
impl Unpin for MetricsSnapshot
impl UnsafeUnpin for MetricsSnapshot
impl UnwindSafe for MetricsSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.