pub struct SessionData {Show 13 fields
pub session_id: String,
pub project: Option<String>,
pub turns: Vec<ValidatedTurn>,
pub subagents: Vec<Subagent>,
pub plugins: Vec<PluginUsage>,
pub skills: Vec<SkillUsage>,
pub hooks: Vec<HookUsage>,
pub first_timestamp: Option<DateTime<Utc>>,
pub last_timestamp: Option<DateTime<Utc>>,
pub version: Option<String>,
pub quality: DataQuality,
pub metadata: SessionMetadata,
pub is_orphan: bool,
}Expand description
Aggregated data from a single session.
Fields§
§session_id: String§project: Option<String>§turns: Vec<ValidatedTurn>§subagents: Vec<Subagent>Subagent groups for this session. Each entry corresponds to one
agent-<id>.jsonl file. Empty for sessions without subagents.
plugins: Vec<PluginUsage>Plugins used in this session (aggregated from main session turns’
attributionPlugin). Empty for pre-2.1.138 sessions.
skills: Vec<SkillUsage>Skills used in this session (aggregated from main session turns’
attributionSkill). Empty for pre-2.1.138 sessions.
hooks: Vec<HookUsage>Hooks triggered in this session (from stop_hook_summary system
entries). Empty for sessions without hooks.
first_timestamp: Option<DateTime<Utc>>§last_timestamp: Option<DateTime<Utc>>§version: Option<String>§quality: DataQuality§metadata: SessionMetadata§is_orphan: boolOrphan session: the parent main session .jsonl was deleted, but
subagent files under <uuid>/subagents/ still exist. Scanner picked
them up and the loader created this session as a placeholder so the
subagent data isn’t lost. Turn / token / cost totals still include
these sessions; this flag only marks them for separate display.
Implementations§
Source§impl SessionData
impl SessionData
Sourcepub fn all_responses(&self) -> Vec<&ValidatedTurn>
pub fn all_responses(&self) -> Vec<&ValidatedTurn>
All API responses (main + every subagent), sorted by timestamp.
Sourcepub fn total_turn_count(&self) -> usize
pub fn total_turn_count(&self) -> usize
Total number of API responses (main + all subagent turns).
Sourcepub fn agent_turn_count(&self) -> usize
pub fn agent_turn_count(&self) -> usize
Total number of agent API responses (sum across all subagents).
Sourcepub fn subagent_type_aggregates(
&self,
calc: &PricingCalculator,
) -> Vec<SubagentTypeAggregate>
pub fn subagent_type_aggregates( &self, calc: &PricingCalculator, ) -> Vec<SubagentTypeAggregate>
Group this session’s subagents by agent_type for chip rendering.
Each output entry corresponds to one agent_type string. Subagents
with agent_type = None are grouped under the literal type
"unknown" (data is preserved, never dropped). Output is sorted by
agent_type ascending for deterministic JSON serialization.
Token / cost totals are summed across each subagent’s turns; the
count field counts the number of Subagent instances per type
(i.e. how many times that type was invoked in this session).
Trait Implementations§
Source§impl Clone for SessionData
impl Clone for SessionData
Source§fn clone(&self) -> SessionData
fn clone(&self) -> SessionData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SessionData
impl RefUnwindSafe for SessionData
impl Send for SessionData
impl Sync for SessionData
impl Unpin for SessionData
impl UnsafeUnpin for SessionData
impl UnwindSafe for SessionData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more