Support Events in trace layer

This commit is contained in:
Louis Dureuil
2024-01-23 16:25:05 +01:00
parent cc79cd0b04
commit b141c82a04
4 changed files with 275 additions and 12 deletions

View File

@@ -33,6 +33,9 @@ pub enum Entry {
/// A call ended
SpanClose(SpanClose),
/// An event occurred
Event(Event),
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
@@ -74,6 +77,15 @@ pub struct SpanExit {
pub memory: Option<MemoryStats>,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub struct Event {
pub call_id: ResourceId,
pub thread_id: ResourceId,
pub parent_id: Option<SpanId>,
pub time: std::time::Duration,
pub memory: Option<MemoryStats>,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub struct NewSpan {
pub id: SpanId,