pub struct MasterMetrics {Show 31 fields
pub tick_duration: Histogram,
pub start_recorded: Histogram,
pub core_lock_wait: Family<ByLabels, Histogram, fn() -> Histogram>,
pub turn_part: Family<PartLabels, Histogram, fn() -> Histogram>,
pub turn_messages: Family<PartLabels, Histogram, fn() -> Histogram>,
pub round_part: Family<PartLabels, Histogram, fn() -> Histogram>,
pub runs: Family<RunLabels, Gauge>,
pub runs_finished: Family<ResultLabels, Counter>,
pub runs_late_failed: Family<LateLabels, Counter>,
pub notifications_sent: Family<ChannelLabels, Counter>,
pub notifications_failed: Family<ChannelLabels, Counter>,
pub retention_deleted: Family<KindLabels, Counter>,
pub tasks: Family<StateLabels, Gauge>,
pub tasks_waiting: Family<ReasonLabels, Gauge>,
pub assignments: Counter,
pub rejections: Family<ReasonLabels, Counter>,
pub attempts_ended: Family<StatusLabels, Counter>,
pub parse_jobs_started: Counter,
pub parse_jobs_finished: Counter,
pub parse_duration: Histogram,
pub commands: Family<CommandLabels, Counter>,
pub command_latency: Histogram,
pub workers: Family<StateLabels, Gauge>,
pub leading: Gauge,
pub replaced_held: Gauge,
pub dags: Family<StateLabels, Gauge>,
pub dag_wakes: Family<ReasonLabels, Counter>,
pub triggers: Family<StateLabels, Gauge>,
pub trigger_events: Family<EventResultLabels, Counter>,
pub trigger_back_pressure_stops: Counter,
pub trigger_idle_restarts: Counter,
/* private fields */
}Expand description
The master’s metrics (cheap to clone; clones share them).
Fields§
§tick_duration: HistogramHow long each tick of the loop took.
start_recorded: HistogramFrom a task’s start on its worker to the master recording it.
core_lock_wait: Family<ByLabels, Histogram, fn() -> Histogram>How long the core lock was waited for, by who waited.
turn_part: Family<PartLabels, Histogram, fn() -> Histogram>How long each part of a worker’s turn held the core lock.
turn_messages: Family<PartLabels, Histogram, fn() -> Histogram>How many messages each part of a worker’s turn handled.
round_part: Family<PartLabels, Histogram, fn() -> Histogram>How long each part of a round took.
runs: Family<RunLabels, Gauge>Runs by state and kind.
runs_finished: Family<ResultLabels, Counter>Runs finished, by DAG and result.
runs_late_failed: Family<LateLabels, Counter>Runs that ended success and learnt of a failure afterwards, by DAG and reason.
notifications_sent: Family<ChannelLabels, Counter>Notifications delivered, by channel.
notifications_failed: Family<ChannelLabels, Counter>Notifications given up on, by channel.
retention_deleted: Family<KindLabels, Counter>What the retention job deleted, by kind.
tasks: Family<StateLabels, Gauge>Task instances of unfinished runs, by state.
tasks_waiting: Family<ReasonLabels, Gauge>Ready tasks no worker could take at the last assignment pass, by reason.
assignments: CounterAttempts assigned to workers.
rejections: Family<ReasonLabels, Counter>Assignments workers rejected, by reason.
attempts_ended: Family<StatusLabels, Counter>Attempts ended, by status.
parse_jobs_started: CounterParse jobs created.
parse_jobs_finished: CounterParse jobs finished (their parse stored).
parse_duration: HistogramHow long parse jobs took, from creation to the stored parse.
commands: Family<CommandLabels, Counter>Commands decided, by kind and decision.
command_latency: HistogramHow long commands waited for their decision.
workers: Family<StateLabels, Gauge>Workers in the registry, by state.
leading: Gauge1 while this master leads (holds the lease), 0 while it waits or is paused.
replaced_held: GaugeStarted attempts of replaced incarnations still held (decision 443).
dags: Family<StateLabels, Gauge>DAGs that can run, by busy (the last scheduler round visited it) / quiet / held.
dag_wakes: Family<ReasonLabels, Counter>DAGs a scheduler round visited after its term’s first, by why (decision 485).
triggers: Family<StateLabels, Gauge>Triggers by state.
trigger_events: Family<EventResultLabels, Counter>Events received from triggers, by result.
trigger_back_pressure_stops: CounterTriggers stopped by back-pressure.
trigger_idle_restarts: CounterTriggers started again for finding nothing for too long.
Implementations§
Source§impl MasterMetrics
impl MasterMetrics
Sourcepub fn core_lock_waited(&self, by: &str, took: Duration)
pub fn core_lock_waited(&self, by: &str, took: Duration)
Records a wait of took for the core lock by by.
Sourcepub fn round_part_done(&self, part: &str, took: Duration)
pub fn round_part_done(&self, part: &str, took: Duration)
Records a part of a round that took took.
Sourcepub fn turn_part_done(&self, part: &str, messages: usize, took: Duration)
pub fn turn_part_done(&self, part: &str, messages: usize, took: Duration)
Records a part of a worker’s turn: messages handled in took.
Sourcepub fn register(&self, registry: &mut Registry)
pub fn register(&self, registry: &mut Registry)
Registers every metric in registry (names get the schedr_ prefix there), as
METRICS describes them.
Sourcepub fn set_dags(&self, busy: usize, quiet: usize, held: usize)
pub fn set_dags(&self, busy: usize, quiet: usize, held: usize)
Sets the busy, quiet and held DAGs’ counts (held ones count as busy or quiet too).
Sourcepub fn set_triggers(&self, counts: TriggerCounts)
pub fn set_triggers(&self, counts: TriggerCounts)
Sets the triggers’ gauge.
Sourcepub fn trigger_event(&self, new: bool)
pub fn trigger_event(&self, new: bool)
Counts an event from a trigger: whether it started a run.
Sourcepub fn set_counts(&self, counts: &StateCounts)
pub fn set_counts(&self, counts: &StateCounts)
Sets the gauges taken from the database.
Sourcepub fn set_waiting(&self, waiting: &[(&'static str, i64)])
pub fn set_waiting(&self, waiting: &[(&'static str, i64)])
Sets the waiting tasks found by an assignment pass, by reason.
Sourcepub fn attempt_ended(&self, status: &impl ToString)
pub fn attempt_ended(&self, status: &impl ToString)
Counts one ended attempt.
Sourcepub fn run_late_failed(&self, dag_id: &str, reason: &str)
pub fn run_late_failed(&self, dag_id: &str, reason: &str)
Counts one run turned a yellow success (decision 309).
Sourcepub fn notification_sent(&self, channel: &str)
pub fn notification_sent(&self, channel: &str)
Counts one notification delivered to channel.
Sourcepub fn notification_failed(&self, channel: &str)
pub fn notification_failed(&self, channel: &str)
Counts one notification to channel given up on.
Sourcepub fn retention_deleted(&self, kind: &str, n: u64)
pub fn retention_deleted(&self, kind: &str, n: u64)
Counts n rows of kind the retention job deleted.
Sourcepub fn run_finished(&self, dag_id: &str, result: &impl ToString)
pub fn run_finished(&self, dag_id: &str, result: &impl ToString)
Counts one finished run.
Source§impl MasterMetrics
impl MasterMetrics
Sourcepub fn stage(&self)
pub fn stage(&self)
From now on attempt ends and run results are held instead of counted, until
Self::count_staged counts them (the transaction committed) or Self::drop_staged
drops them (it rolled back, and its messages will be handled again: M4B.3, so no
result is counted twice).
Sourcepub fn count_staged(&self)
pub fn count_staged(&self)
Counts what was held, and stops holding.
Sourcepub fn drop_staged(&self)
pub fn drop_staged(&self)
Drops what was held, and stops holding.
Trait Implementations§
Source§impl Clone for MasterMetrics
impl Clone for MasterMetrics
Source§fn clone(&self) -> MasterMetrics
fn clone(&self) -> MasterMetrics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MasterMetrics
impl Debug for MasterMetrics
Auto Trait Implementations§
impl !RefUnwindSafe for MasterMetrics
impl !UnwindSafe for MasterMetrics
impl Freeze for MasterMetrics
impl Send for MasterMetrics
impl Sync for MasterMetrics
impl Unpin for MasterMetrics
impl UnsafeUnpin for MasterMetrics
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
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> ⓘ
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> ⓘ
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>
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>,
Layered].§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);