Skip to main content

Api

Struct Api 

Source
pub struct Api {
Show 19 fields pub requests: BTreeMap<(&'static str, String, String), u64>, pub latency: BTreeMap<String, ([u64; 9], u64, f64)>, pub ws_sessions: u64, pub ws_sessions_total: u64, pub forwarded: BTreeMap<String, u64>, pub response_bytes: BTreeMap<String, u64>, pub proofs: BTreeMap<(String, String), u64>, pub proof_cache_hits: u64, pub inflight: u64, pub inflight_proofs: u64, pub inflight_forwards: u64, pub public_inflight: u64, pub public_inflight_proofs: u64, pub public_inflight_forwards: u64, pub public_sessions: u64, pub subscribers: BTreeMap<&'static str, u64>, pub subscribed_accounts: u64, pub ws_dropped: u64, pub rejected: BTreeMap<(&'static str, &'static str), u64>,
}
Expand description

Requests to the Clio-compatible API. Methods and statuses come from a bounded set (the server folds unknown ones into other), so the series stay few.

Fields§

§requests: BTreeMap<(&'static str, String, String), u64>

Requests by (transport, method, status), status being success or the error name.

§latency: BTreeMap<String, ([u64; 9], u64, f64)>

Latency by method: requests per bucket (not cumulative), count, sum.

§ws_sessions: u64

Open WebSocket sessions.

§ws_sessions_total: u64§forwarded: BTreeMap<String, u64>

Requests answered by the node, by method.

§response_bytes: BTreeMap<String, u64>

Response bytes by method.

§proofs: BTreeMap<(String, String), u64>

Proof bundles built, by (method, how the target was confirmed).

§proof_cache_hits: u64§inflight: u64

Requests being served now, regular and proofs.

§inflight_proofs: u64§inflight_forwards: u64§public_inflight: u64

The same on the public listeners, and their open sessions.

§public_inflight_proofs: u64§public_inflight_forwards: u64§public_sessions: u64§subscribers: BTreeMap<&'static str, u64>

Sessions subscribed to each stream, and accounts subscribed in all.

§subscribed_accounts: u64§ws_dropped: u64

Sessions disconnected for not reading their messages.

§rejected: BTreeMap<(&'static str, &'static str), u64>

Requests refused to protect the server, by (door, reason).

Implementations§

Source§

impl Api

Source

pub fn record( &mut self, transport: &'static str, method: &str, status: &str, seconds: f64, bytes: usize, forwarded: bool, )

Trait Implementations§

Source§

impl Debug for Api

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Api

Source§

fn default() -> Api

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Api

§

impl RefUnwindSafe for Api

§

impl Send for Api

§

impl Sync for Api

§

impl Unpin for Api

§

impl UnsafeUnpin for Api

§

impl UnwindSafe for Api

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

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> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more