[][src]Trait nakadion::instrumentation::Instruments

pub trait Instruments {
    pub fn consumer_started(&self) { ... }
pub fn consumer_stopped(&self, _ran_for: Duration) { ... }
pub fn streaming_ended(&self, _streamed_for: Duration) { ... }
pub fn stream_connect_attempt_success(&self, _time: Duration) { ... }
pub fn stream_connect_attempt_failed(&self, _time: Duration) { ... }
pub fn stream_connected(&self, _time: Duration) { ... }
pub fn stream_not_connected(&self, _time: Duration, _err: &ConnectError) { ... }
pub fn stream_chunk_received(&self, _n_bytes: usize) { ... }
pub fn stream_frame_completed(&self, _n_bytes: usize, _time: Duration) { ... }
pub fn stream_tick_emitted(&self) { ... }
pub fn info_frame_received(
        &self,
        _frame_started_at: Instant,
        _frame_completed_at: Instant
    ) { ... }
pub fn keep_alive_frame_received(
        &self,
        _frame_started_at: Instant,
        _frame_completed_at: Instant
    ) { ... }
pub fn batch_frame_received(
        &self,
        _frame_started_at: Instant,
        _frame_completed_at: Instant,
        _events_bytes: usize
    ) { ... }
pub fn batch_frame_gap(&self, _gap: Duration) { ... }
pub fn no_frames_warning(&self, _no_frames_for: Duration) { ... }
pub fn no_events_warning(&self, _no_events_for: Duration) { ... }
pub fn stream_dead(&self, _after: Duration) { ... }
pub fn stream_error(&self, _err: &EventStreamError) { ... }
pub fn stream_unconsumed_events(&self, _n_unconsumed: usize) { ... }
pub fn batches_in_flight_incoming(&self, _stats: &EventStreamBatchStats) { ... }
pub fn batches_in_flight_processed(&self, _stats: &EventStreamBatchStats) { ... }
pub fn in_flight_stats_reset(&self) { ... }
pub fn event_type_partition_activated(&self) { ... }
pub fn event_type_partition_deactivated(&self, _active_for: Duration) { ... }
pub fn batch_processing_started(
        &self,
        _frame_started_at: Instant,
        _frame_completed_at: Instant
    ) { ... }
pub fn batch_processed(&self, _n_bytes: usize, _time: Duration) { ... }
pub fn batch_processed_n_events(&self, _n_events: usize) { ... }
pub fn batch_deserialized(&self, _n_bytes: usize, _time: Duration) { ... }
pub fn cursor_to_commit_received(
        &self,
        _frame_started_at: Instant,
        _frame_completed_at: Instant
    ) { ... }
pub fn cursors_commit_triggered(&self, _trigger: CommitTrigger) { ... }
pub fn cursor_ages_on_commit_attempt(
        &self,
        _first_cursor_age: Duration,
        _last_cursor_age: Duration,
        _first_cursor_age_warning: bool
    ) { ... }
pub fn cursors_committed(&self, _n_cursors: usize, _time: Duration) { ... }
pub fn batches_committed(&self, _n_batches: usize, _n_events: usize) { ... }
pub fn cursors_not_committed(
        &self,
        _n_cursors: usize,
        _time: Duration,
        _err: &CommitError
    ) { ... }
pub fn commit_cursors_attempt_failed(
        &self,
        _n_cursors: usize,
        _time: Duration
    ) { ... }
pub fn stream_parameters(&self, _params: &StreamParameters) { ... } }

An interface on which Nakadion exposes metrics

An implementor of this interface can be used with Instrumentation::new

Implementations of this trait should not be shared with multiple consumers since they are stateful e.g. in flight batches.

Provided methods

pub fn consumer_started(&self)[src]

pub fn consumer_stopped(&self, _ran_for: Duration)[src]

pub fn streaming_ended(&self, _streamed_for: Duration)[src]

pub fn stream_connect_attempt_success(&self, _time: Duration)[src]

Triggered when a single connect attempt for a stream was successful

time is the time for the request

pub fn stream_connect_attempt_failed(&self, _time: Duration)[src]

Triggered when a single connect attempt for a stream failed

time is the time for the request

pub fn stream_connected(&self, _time: Duration)[src]

Triggered when a stream was finally connect after maybe multiple attempts

time is the time for the whole cycle until a connection was made

pub fn stream_not_connected(&self, _time: Duration, _err: &ConnectError)[src]

Triggered when connecting to a stream finally failed after maybe multiple attempts

time is the time for the whole cycle until a connection attempts finally failed

pub fn stream_chunk_received(&self, _n_bytes: usize)[src]

A chunk of data with n_bytes was received over the network

pub fn stream_frame_completed(&self, _n_bytes: usize, _time: Duration)[src]

Chunks have been assembled to a complete frame containing all required data

pub fn stream_tick_emitted(&self)[src]

An internal tick signal has been emitted

pub fn info_frame_received(
    &self,
    _frame_started_at: Instant,
    _frame_completed_at: Instant
)
[src]

The controller received a frame which contained info data

The time it took from receiving the first chunk until it reached the controller are passed along with the complete bytes of the frame

pub fn keep_alive_frame_received(
    &self,
    _frame_started_at: Instant,
    _frame_completed_at: Instant
)
[src]

The controller received a frame which contained no events

The time it took from receiving the first chunk until it reached the controller are passed along with the complete bytes of the frame

pub fn batch_frame_received(
    &self,
    _frame_started_at: Instant,
    _frame_completed_at: Instant,
    _events_bytes: usize
)
[src]

A partition which was formerly not known to be active was sent data on The controller received a frame which contained events

The time it took from receiving the first chunk until it reached the controller are passed along with the complete bytes of the frame

pub fn batch_frame_gap(&self, _gap: Duration)[src]

The time elapsed between the reception of 2 batches with events

pub fn no_frames_warning(&self, _no_frames_for: Duration)[src]

No frames have been received for the given time and the warning has already threshold elapsed

pub fn no_events_warning(&self, _no_events_for: Duration)[src]

No events have been received for the given time and the warning threshold has already elapsed

pub fn stream_dead(&self, _after: Duration)[src]

pub fn stream_error(&self, _err: &EventStreamError)[src]

The stream was aborted due to a streaming related error

pub fn stream_unconsumed_events(&self, _n_unconsumed: usize)[src]

Tracks the number of unconsumed events.

Only available if the Consumer was created with a clients that supports the SubscriptionApi

pub fn batches_in_flight_incoming(&self, _stats: &EventStreamBatchStats)[src]

Triggered when a new batch with events was received

pub fn batches_in_flight_processed(&self, _stats: &EventStreamBatchStats)[src]

Triggered when a batch with events was processed

pub fn in_flight_stats_reset(&self)[src]

Usually triggered when there are still batches in flight and the stream aborts.

This is a correction for the inflight metrics and uncommitted events metrics

pub fn event_type_partition_activated(&self)[src]

pub fn event_type_partition_deactivated(&self, _active_for: Duration)[src]

A partition did not receive data for some time is is therefore considered inactive.

pub fn batch_processing_started(
    &self,
    _frame_started_at: Instant,
    _frame_completed_at: Instant
)
[src]

pub fn batch_processed(&self, _n_bytes: usize, _time: Duration)[src]

Events were processed.

pub fn batch_processed_n_events(&self, _n_events: usize)[src]

Events were processed.

pub fn batch_deserialized(&self, _n_bytes: usize, _time: Duration)[src]

Events have been deserialized.

The amount of bytes deserialized and the time it took are passed.

pub fn cursor_to_commit_received(
    &self,
    _frame_started_at: Instant,
    _frame_completed_at: Instant
)
[src]

Cursors to be committed have reached the commit stage.

The time it took from receiving the first chunk until it reached the commit stage are passed

pub fn cursors_commit_triggered(&self, _trigger: CommitTrigger)[src]

Cursors commit was triggered.

pub fn cursor_ages_on_commit_attempt(
    &self,
    _first_cursor_age: Duration,
    _last_cursor_age: Duration,
    _first_cursor_age_warning: bool
)
[src]

Ages of the cursors when making a commit attempt to Nakadi

This ages are measured before making an attempt to make a call to Nakadi. first_cursor_age is the critical age of the first cursor which might be commited with a later cursor which has the age last_cursor_age.

`` should be true, when the first cursor reached a critical age which might endanger or even cause the commit to fail.

pub fn cursors_committed(&self, _n_cursors: usize, _time: Duration)[src]

Cursors were successfully committed.

The time request took is passed. A call to this method must not influence the uncommitted batches stats. Use batches_committed instead.

pub fn batches_committed(&self, _n_batches: usize, _n_events: usize)[src]

Tracks what has been committed to track uncommitted batches and their events.

Collected values should be reset by in_flight_stats_reset

pub fn cursors_not_committed(
    &self,
    _n_cursors: usize,
    _time: Duration,
    _err: &CommitError
)
[src]

Cursors were not successfully committed.

The time request took is passed

pub fn commit_cursors_attempt_failed(&self, _n_cursors: usize, _time: Duration)[src]

An attempt to commit cursors failed. There might still be a retry

The time request took is passed

pub fn stream_parameters(&self, _params: &StreamParameters)[src]

Can be used to transmit limits and values via metrics

This function s not called at high frequency

Loading content...

Implementors

impl Instruments for Metrix[src]

impl Instruments for Instrumentation[src]

Loading content...