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
impl Event
sourcepub fn activity_length(&self) -> usize
pub fn activity_length(&self) -> usize
The length of the string in Event::activity.
Used for nicer formatting.
sourcepub fn durations(&self) -> (i64, i64)
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.
sourcepub fn sum_of_child_durations(&self) -> i64
pub fn sum_of_child_durations(&self) -> i64
Returns the total sum of all children’s durations.
sourcepub fn waterfall(
&self,
config: &Cli,
offset: i64,
session_duration: i64
) -> String
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.
sourcepub fn display(
&self,
config: &Cli,
min_activity_width: usize,
depth: usize,
max_depth: usize
) -> String
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