Skip to main content

Monitors

Struct Monitors 

Source
pub struct Monitors { /* private fields */ }
Expand description

The monitoring service.

Implementations§

Source§

impl Monitors

Source

pub fn new( state: &Path, apps: Apps, secrets: Arc<Secrets>, allow_private: AllowPrivate, public_url: Option<String>, ) -> Monitors

Source

pub fn with_tls(self, tls: Arc<ClientConfig>) -> Monitors

Trust these TLS roots instead of the public set (tests).

Source

pub fn orgs(&self) -> Vec<OrgId>

The orgs with state on this daemon.

Source

pub fn list(&self, org: &OrgId) -> Result<Vec<Monitor>>

Source

pub fn get(&self, org: &OrgId, name: &str) -> Result<Monitor>

Source

pub fn settings(&self, org: &OrgId) -> Result<Settings>

Source

pub fn set_settings(&self, org: &OrgId, s: &Settings) -> Result<()>

Source

pub fn create(&self, org: &OrgId, m: Monitor) -> Result<Monitor>

Source

pub fn update( &self, org: &OrgId, name: &str, patch: Map<String, Value>, ) -> Result<Monitor>

Change fields of a monitor: patch holds the fields to set (null puts a field back to its default). The name stays.

Source

pub fn delete(&self, org: &OrgId, name: &str) -> Result<Monitor>

Remove a monitor and its history. An app’s or a stack service’s own monitor stays away: it joins the org’s exclusions.

Source

pub fn set_paused( &self, org: &OrgId, name: &str, paused: bool, ) -> Result<Monitor>

Source

pub fn sync_auto(&self, org: &OrgId) -> Result<()>

Give every app and compose stack service with a served domain its own monitor, and remove those whose target is gone, has no domains, or opted out (auto).

Source

pub fn start(&self)

Start the scheduler and the workers.

Source

pub fn shutdown(&self)

Source

pub fn stopper(&self) -> Arc<AtomicBool> ⓘ

Set by Monitors::shutdown: what the heartbeat stops on too.

Source

pub fn check(&self, org: &OrgId, m: &Monitor) -> Outcome

Run one check now. An app’s or stack service’s monitor that has not been up yet does not look at it until it has a live deployment: the check fails as “waiting”, which the state machine keeps as pending.

Source

pub fn record(&self, org: &OrgId, m: &Monitor, o: Outcome) -> Result<()>

Keep a check’s result, step the state machine, raise events.

The web UI’s page of a monitor, when isb knows its public URL.

Source

pub fn details(&self, org: &OrgId, kind: &str, message: &str) -> Option<Value>

The details of an event this service raised, for the notifier.

Source§

impl Monitors

Source

pub fn summary(&self, org: &OrgId, m: &Monitor) -> Result<Value>

One monitor as listings show it: its definition, status (up, down, pending, paused), never_up (pending for 30 minutes with only failures), the last check, uptime over 24 h, 7 d and 30 d, latency p50/p95 over 24 h, 24 hourly bars ([start, uptime, pending checks]) and the last 30 latencies.

Source

pub fn overview(&self, org: &OrgId) -> Result<Value>

Every monitor of the org, its recent incidents and its settings.

Source

pub fn detail(&self, org: &OrgId, name: &str) -> Result<Value>

A monitor with its last 20 incidents and checks.

Source

pub fn history( &self, org: &OrgId, name: &str, r: &str, limit: usize, ) -> Result<Value>

A monitor’s history over range: buckets (uptime, p50, p95), the uptime over the whole range, and the newest raw checks.

Trait Implementations§

Source§

impl Clone for Monitors

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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
Source§

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

Source§

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

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

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

Source§

fn vzip(self) -> V