Skip to main content

PvCounters

Struct PvCounters 

Source
pub struct PvCounters {
    pub events_received: AtomicU64,
    pub events_stored: AtomicU64,
    pub first_event_unix_secs: AtomicI64,
    pub buffer_overflow_drops: AtomicU64,
    pub timestamp_drops: AtomicU64,
    pub type_change_drops: AtomicU64,
    pub disconnect_count: AtomicU64,
    pub last_disconnect_unix_secs: AtomicI64,
    pub transient_error_count: AtomicU64,
    pub latest_observed_dbr: AtomicI32,
    pub metadata_fetch_failures: AtomicU64,
    pub storage_append_timeouts: AtomicU64,
}
Expand description

Per-PV diagnostic counters for the BPL drop / rate / connection reports. All counts are monotonic across the PV’s lifetime; the rate handlers compute deltas against first_event_unix_secs.

Tracked here (not in ConnectionInfo) so they survive transient disconnects and are read lock-free from the report endpoints.

Fields§

§events_received: AtomicU64

Total events produced by monitor/scan, including those that later got dropped before write.

§events_stored: AtomicU64

Total events successfully written to storage.

§first_event_unix_secs: AtomicI64

Unix-epoch seconds of the first event we ever saw for this PV. 0 = “no event yet” (i64 because Atomic<Option<…>> doesn’t exist).

§buffer_overflow_drops: AtomicU64

Number of events the bounded sample channel rejected (write loop falling behind producer). Surfaces as getDroppedEventsBufferOverflowReport.

§timestamp_drops: AtomicU64

Number of events whose timestamp went backwards relative to the previously-stored event. Java archiver’s DroppedEventsTimestampReport.

§type_change_drops: AtomicU64

Number of events whose runtime DBR type didn’t match the PvRecord’s stored type — the engine drops these because mixing types in one PB partition would corrupt downstream readers.

§disconnect_count: AtomicU64

Number of disconnect transitions seen on this PV’s CA channel. LostConnectionsReport.

§last_disconnect_unix_secs: AtomicI64

Last unix-epoch seconds of disconnect transition.

§transient_error_count: AtomicU64

Number of transient subscribe / monitor-recv / scan-read errors (Java parity 8fe73eb). Distinct from disconnect_count — these are recoverable per-attempt failures rather than confirmed link drops.

§latest_observed_dbr: AtomicI32

Latest DBR type observed from CA that did not match the archive-time recorded type (Java parity 9f2234f). -1 = no mismatch ever seen.

§metadata_fetch_failures: AtomicU64

Number of DBR_CTRL metadata refresh attempts that failed (timeout, transport error, missing display info). Operators looking at PVs with empty PREC/EGU should check this.

§storage_append_timeouts: AtomicU64

Number of storage.append_event_with_meta calls that exceeded the per-sample storage timeout. Distinct from buffer_overflow_drops (mpsc channel saturation) so an operator can tell “the storage tier is wedged” apart from “the writer can’t keep up with the producer”.

Trait Implementations§

Source§

impl Debug for PvCounters

Source§

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

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

impl Default for PvCounters

Source§

fn default() -> Self

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

impl From<&PvCounters> for PvCountersSnapshot

Source§

fn from(c: &PvCounters) -> Self

Converts to this type from the input type.

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> 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, 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.
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