Struct seella::Event

source ·
pub struct Event {
    pub id: Uuid,
    pub session_id: Uuid,
    pub activity: String,
    pub source: IpAddr,
    pub duration: Duration,
    pub thread: String,
    pub span_id: SpanId,
    pub parent_span_id: SpanId,
    /* private fields */
}
Expand description

All of the information related to an event, as well as all child events.

Fields§

§id: Uuid

The UUID of the Event

§session_id: Uuid

The UUID of the Session

§activity: String

What is being done in this Event

§source: IpAddr

The source IP for this Event

§duration: Duration

Duration of this only this Event, not including child events

§thread: String

The name of the thread from which this Event originated

§span_id: SpanId

Unique identifier for this Event’s span Not present in Cassandra

§parent_span_id: SpanId

Span ID for this Event’s parent. Used to identity the tree structure Not present in Cassandra

Implementations§

source§

impl Event

source

pub fn activity_length(&self) -> usize

The length of the string in Event::activity.

Used for nicer formatting.

source

pub fn durations(&self) -> (i64, i64)

Return the total duration of this span and it’s children, and the duration of just this span.

First field is the total, second field is just this span.

source

pub fn sum_of_child_durations(&self) -> i64

Returns the total sum of all children’s durations.

source

pub fn waterfall( &self, config: &Cli, offset: i64, session_duration: i64 ) -> String

Generate a waterfall chart from the trace data.

The intention of this is to show the proportion of the total trace taken up by this span, and where it lies relative to the start and end of the span.

This is in the format of:

[  <blank spaces>  █████<duration of the span>█████───<duration of child spans>───┤   <blank spaces>   ]

offset is the time in microseconds since the start of the trace to this span. session_duration is the total duration of the session.

source

pub fn display( &self, config: &Cli, min_activity_width: usize, depth: usize, max_depth: usize ) -> String

Generates a texttual representation of the event to display alongside the waterfall view.

This contains, by default, the span duration, source node IP, and the activity:

    0 10.17.145.76    Querying is done

This can be extended with the config to include the event id, the local and parent span IDs, and the thread name:

    0 10.17.145.76    Querying is done     3d07a953-313e-11ee-95bc-69d50677a8c4 75964065742287       191362128677         shard 2

Trait Implementations§

source§

impl Debug for Event

source§

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

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

impl From<EventRecord> for Event

source§

fn from(value: EventRecord) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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

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

§

fn vzip(self) -> V

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