Skip to main content

LifecycleEvent

Enum LifecycleEvent 

Source
pub enum LifecycleEvent {
    DemandObserved {
        policy: PolicyId,
        demand: u32,
        not_matched: u32,
        unresolvable: u32,
        complete: bool,
    },
    TargetUnreadable {
        policy: PolicyId,
        reason: &'static str,
    },
    Allocated {
        policy: PolicyId,
        demand: u32,
        desired: u16,
        active_owned: u16,
        headroom: u16,
        to_start: u16,
        limiting: LimitingFactor,
    },
    MonitorOnlySkipped {
        policy: PolicyId,
    },
    RunnerStarted {
        policy: PolicyId,
        attempt: AttemptId,
    },
    RunnerStartFailed {
        policy: PolicyId,
        reason: &'static str,
    },
    AllocationDeferred {
        policy: PolicyId,
        count: u16,
    },
    AttemptsUnreadable {
        reason: &'static str,
    },
    AttemptCleaned {
        policy: PolicyId,
        attempt: AttemptId,
        outcome: OutcomeKind,
    },
    AttemptCleanFailed {
        policy: PolicyId,
        attempt: AttemptId,
        reason: &'static str,
    },
    ScaleDownRefused {
        policy: PolicyId,
        attempt: AttemptId,
    },
    PollScheduled {
        retry_in_ms: u64,
        pace: PollPace,
    },
}
Expand description

What g2’s activity view and the local log sink see.

Every field is an identifier, a count, a duration, or a &'static str drawn from a closed set. There is no String anywhere in this enum, which is what makes “no emitted event contains a token, a JIT blob, or a credential header” a property of the type rather than a discipline each call site has to keep. tests::no_emitted_event_can_carry_a_credential renders every variant through d1’s scrubber and asserts nothing changes, with a positive control so the assertion cannot pass vacuously.

Variants§

§

DemandObserved

A demand poll answered for one target.

Fields

§policy: PolicyId
§demand: u32

Queued jobs this policy’s routing labels match. The number clamped.

§not_matched: u32

Queued jobs whose required labels this policy does not carry.

Never demand. Reported because the difference between this and demand is the whole value of the label filtering, and an operator wondering why a busy repository started no runners is owed it.

§unresolvable: u32

Queued jobs whose runs-on could not be resolved statically.

b1 requires these be “reported as unresolvable rather than silently counted or silently dropped”: counting one would start a runner for a job that may not be ours, and dropping it would hide a workflow this host can never serve. A count rather than the reasons themselves because this type is Copy, and c4 logs the reasons where it builds them.

§complete: bool

false when the count is a floor rather than a total.

§

TargetUnreadable

A target could not be polled, so its policies start nothing this pass.

Fields

§policy: PolicyId
§reason: &'static str
§

Allocated

One policy’s share of the pass.

Fields

§policy: PolicyId
§demand: u32
§desired: u16
§active_owned: u16
§headroom: u16
§to_start: u16
§

MonitorOnlySkipped

A monitor-only policy was skipped entirely, before any demand request was issued for it (D19).

Fields

§policy: PolicyId
§

RunnerStarted

One runtime was created and one runner started.

Fields

§policy: PolicyId
§attempt: AttemptId
§

RunnerStartFailed

One runner could not be started.

Fields

§policy: PolicyId
§reason: &'static str
§

AllocationDeferred

The allocation lock was not free, so count runners this policy was granted were not created this pass.

Fields

§policy: PolicyId
§count: u16
§

AttemptsUnreadable

The host’s attempt set could not be read at all.

Distinct from an empty set on purpose, and the whole reason RunnerLauncher::attempts is fallible: the two produce the same number and demand opposite actions.

Fields

§reason: &'static str
§

AttemptCleaned

A terminal attempt’s runtime was removed.

Fields

§policy: PolicyId
§attempt: AttemptId
§outcome: OutcomeKind
§

AttemptCleanFailed

A terminal attempt’s runtime could not be removed. It will be retried on the next pass, and this is what keeps that retry from being silent.

Fields

§policy: PolicyId
§attempt: AttemptId
§reason: &'static str
§

ScaleDownRefused

Scale-down declined to remove a runner that is executing a job.

Fields

§policy: PolicyId
§attempt: AttemptId
§

PollScheduled

When the next poll is, and why then.

Fields

§retry_in_ms: u64

Implementations§

Source§

impl LifecycleEvent

Source

pub const fn name(&self) -> &'static str

A fixed name, for the event field d1’s sink allows verbatim.

Source

pub const fn policy(&self) -> Option<PolicyId>

Which policy this event is about.

Trait Implementations§

Source§

impl Clone for LifecycleEvent

Source§

fn clone(&self) -> LifecycleEvent

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

impl Copy for LifecycleEvent

Source§

impl Debug for LifecycleEvent

Source§

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

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

impl Display for LifecycleEvent

Source§

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

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

impl Eq for LifecycleEvent

Source§

impl PartialEq for LifecycleEvent

Source§

fn eq(&self, other: &LifecycleEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LifecycleEvent

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<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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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