Documentation
¶
Index ¶
- Constants
- func AggregateActivityBuckets(sessions []conv.Session) []conv.ActivityBucketRow
- func ComputeSessionDurationStatistic(sessions []conv.SessionMeta, mode StatisticMode) time.Duration
- func ComputeSessionMessageStatistic(sessions []conv.SessionMeta, mode StatisticMode) float64
- func ComputeToolCallsPerSessionStatistic(sessions []conv.SessionMeta, mode StatisticMode) float64
- func FilterByTimeRange(sessions []conv.SessionMeta, tr TimeRange) []conv.SessionMeta
- func FormatNumber(n int) string
- func FormatValue(id string, value float64) string
- func IsMemoryWriteCall(call conv.ToolCall) bool
- func NormalizeVersionLabel(version string) string
- type Activity
- type ActivityBucketRow
- type ActivityBySplit
- type Cache
- type CacheBySplit
- type CacheDurationBucket
- type CacheFirstTurnVersionStat
- type CacheSegment
- type DailyCount
- type DailyRate
- type DailyValue
- type HistogramBucket
- type ModelTokens
- type Overview
- type Performance
- type PerformanceDiagnostic
- type PerformanceLane
- type PerformanceMetric
- type PerformanceMetricStatus
- type PerformancePoint
- type PerformanceScope
- type PerformanceScore
- type PerformanceSequenceSession
- type PositionTokenMetrics
- func ComputeTurnTokenMetrics(sessions []conv.Session) []PositionTokenMetrics
- func ComputeTurnTokenMetricsForRange(sessions []SessionTurnMetrics, timeRange TimeRange) []PositionTokenMetrics
- func ComputeTurnTokenMetricsForRangeWithMode(sessions []SessionTurnMetrics, timeRange TimeRange, mode StatisticMode) []PositionTokenMetrics
- type ProjectTokens
- type ProviderVersionTokens
- type SessionSummary
- type SessionToolMetrics
- type SessionTurnMetrics
- type Sessions
- type Snapshot
- type SplitDailyShare
- type SplitDailyValueSeries
- type SplitDimension
- type SplitHistogramBucket
- type SplitNamedStat
- type SplitRateStat
- type SplitTurnSeries
- type SplitValue
- type StatisticMode
- type TimeRange
- type TokenTotals
- type TokenTrend
- type ToolCategoryShare
- type ToolRateStat
- type ToolStat
- type Tools
- type ToolsBySplit
- type TrendDirection
- type TurnTokens
Constants ¶
View Source
const UnknownSplitKey = "unknown"
View Source
const UnknownVersionLabel = UnknownSplitKey
UnknownVersionLabel is preserved as an alias for UnknownSplitKey because callers normalize blank session versions to the same fallback as other blank split keys.
Variables ¶
This section is empty.
Functions ¶
func AggregateActivityBuckets ¶ added in v0.3.0
func AggregateActivityBuckets(sessions []conv.Session) []conv.ActivityBucketRow
func ComputeSessionDurationStatistic ¶ added in v0.4.0
func ComputeSessionDurationStatistic(sessions []conv.SessionMeta, mode StatisticMode) time.Duration
func ComputeSessionMessageStatistic ¶ added in v0.4.0
func ComputeSessionMessageStatistic(sessions []conv.SessionMeta, mode StatisticMode) float64
func ComputeToolCallsPerSessionStatistic ¶ added in v0.4.0
func ComputeToolCallsPerSessionStatistic(sessions []conv.SessionMeta, mode StatisticMode) float64
func FilterByTimeRange ¶
func FilterByTimeRange(sessions []conv.SessionMeta, tr TimeRange) []conv.SessionMeta
func FormatNumber ¶
func FormatValue ¶
FormatValue renders a performance metric value using the metric's display convention.
func IsMemoryWriteCall ¶ added in v0.4.0
IsMemoryWriteCall reports whether a tool call mutates a Claude-style memory file. The call must classify as mutate or rewrite and target a file-path ending in `/memory/<name>.md` or `/MEMORY.md`.
func NormalizeVersionLabel ¶ added in v0.4.0
Types ¶
type Activity ¶
type Activity struct {
ActiveDays int
TotalDays int
CurrentStreak int
LongestStreak int
DailySessions []DailyCount
DailyMessages []DailyCount
DailyTokens []DailyCount
Heatmap [7][24]int
}
func ComputeActivity ¶
func ComputeActivity(sessions []conv.SessionMeta, timeRange TimeRange) Activity
func ComputeActivityFromBuckets ¶ added in v0.3.0
func ComputeActivityFromBuckets( sessions []conv.SessionMeta, activityBuckets []conv.ActivityBucketRow, timeRange TimeRange, ) Activity
type ActivityBucketRow ¶ added in v0.3.0
type ActivityBucketRow = conv.ActivityBucketRow
type ActivityBySplit ¶ added in v0.4.0
type ActivityBySplit struct {
DailySessions []SplitDailyValueSeries
DailyMessages []SplitDailyValueSeries
DailyTokens []SplitDailyValueSeries
}
func ComputeActivityBySplit ¶ added in v0.4.0
func ComputeActivityBySplit( sessions []conv.SessionMeta, activityBuckets []conv.ActivityBucketRow, timeRange TimeRange, dim SplitDimension, allowed map[string]bool, ) ActivityBySplit
type Cache ¶ added in v0.3.0
type Cache struct {
TotalCacheRead int
TotalCacheWrite int
TotalPrompt int
HitRate float64
WriteRate float64
MissRate float64
ReuseRatio float64
Main CacheSegment
Subagent CacheSegment
DailyHitRate []DailyRate
DailyReuseRatio []DailyRate
DurationBuckets []CacheDurationBucket
FirstTurnByVersion []CacheFirstTurnVersionStat
}
func ComputeCache ¶ added in v0.3.0
func ComputeCache(sessions []conv.SessionMeta, timeRange TimeRange) Cache
type CacheBySplit ¶ added in v0.4.0
type CacheBySplit struct {
SegmentRows []SplitNamedStat
ReadDuration []SplitHistogramBucket
WriteDuration []SplitHistogramBucket
}
func ComputeCacheBySplit ¶ added in v0.4.0
func ComputeCacheBySplit( sessions []conv.SessionMeta, timeRange TimeRange, dim SplitDimension, allowed map[string]bool, ) CacheBySplit
type CacheDurationBucket ¶ added in v0.3.0
type CacheFirstTurnVersionStat ¶ added in v0.4.0
type CacheFirstTurnVersionStat struct {
Version string
SessionCount int
ZeroCount int
ZeroReadRate float64
MedianFirstRead int
}
func ComputeCacheFirstTurnByVersion ¶ added in v0.4.0
func ComputeCacheFirstTurnByVersion(series []conv.SessionTurnMetrics) []CacheFirstTurnVersionStat
ComputeCacheFirstTurnByVersion returns the share of Claude sessions whose first turn came in with zero cache reads, grouped by normalized version. Groups with fewer than cacheFirstTurnMinSessions sessions are dropped.
type CacheSegment ¶ added in v0.3.0
type DailyCount ¶
type DailyValue ¶ added in v0.4.0
type HistogramBucket ¶
type ModelTokens ¶
type Overview ¶
type Overview struct {
SessionCount int
MessageCount int
Tokens TokenTotals
TokenTrend TokenTrend
ByModel []ModelTokens
ByProject []ProjectTokens
ByProviderVersion []ProviderVersionTokens
TopSessions []SessionSummary
}
func ComputeOverview ¶
func ComputeOverview(sessions []conv.SessionMeta) Overview
type Performance ¶
type Performance struct {
Scope PerformanceScope
Overall PerformanceScore
Outcome PerformanceLane
Discipline PerformanceLane
Efficiency PerformanceLane
Robustness PerformanceLane
Diagnostics []PerformanceDiagnostic
}
func ComputePerformance ¶
func ComputePerformance( conversations []conv.Conversation, timeRange TimeRange, sequence []PerformanceSequenceSession, ) Performance
type PerformanceDiagnostic ¶
type PerformanceDiagnostic struct {
Group string
Label string
Value string
Detail string
Current float64
Baseline float64
HasBaseline bool
Trend TrendDirection
Series []PerformancePoint
}
type PerformanceLane ¶
type PerformanceLane struct {
Label string
Detail string
Score int
HasScore bool
Trend TrendDirection
Metrics []PerformanceMetric
}
type PerformanceMetric ¶
type PerformanceMetric struct {
ID string
Label string
Value string
Detail string
Question string
Formula string
Current float64
Baseline float64
DeltaText string
HasBaseline bool
Score int
ScoreWeight float64
HasScore bool
Trend TrendDirection
Status PerformanceMetricStatus
SampleCount int
HigherIsBetter bool
Series []PerformancePoint
}
type PerformanceMetricStatus ¶
type PerformanceMetricStatus int
const ( PerformanceMetricStatusNone PerformanceMetricStatus = iota PerformanceMetricStatusBetter PerformanceMetricStatusWorse PerformanceMetricStatusFlat PerformanceMetricStatusLowSample )
type PerformancePoint ¶
type PerformanceScope ¶
type PerformanceScore ¶
type PerformanceScore struct {
Score int
HasScore bool
Trend TrendDirection
}
type PerformanceSequenceSession ¶
type PerformanceSequenceSession = conv.PerformanceSequenceSession
func CollectPerformanceSequenceSessions ¶
func CollectPerformanceSequenceSessions(sessions []conv.Session) []PerformanceSequenceSession
type PositionTokenMetrics ¶
type PositionTokenMetrics struct {
Position int
AveragePromptTokens float64
AverageTurnTokens float64
SampleCount int
}
func ComputeTurnTokenMetrics ¶
func ComputeTurnTokenMetrics(sessions []conv.Session) []PositionTokenMetrics
func ComputeTurnTokenMetricsForRange ¶
func ComputeTurnTokenMetricsForRange( sessions []SessionTurnMetrics, timeRange TimeRange, ) []PositionTokenMetrics
func ComputeTurnTokenMetricsForRangeWithMode ¶ added in v0.4.0
func ComputeTurnTokenMetricsForRangeWithMode( sessions []SessionTurnMetrics, timeRange TimeRange, mode StatisticMode, ) []PositionTokenMetrics
type ProjectTokens ¶
type ProviderVersionTokens ¶ added in v0.4.0
type SessionSummary ¶
type SessionToolMetrics ¶
type SessionToolMetrics struct {
Timestamp time.Time
ToolCounts map[string]int
ActionCounts map[string]int
ToolErrorCounts map[string]int
ToolRejectCounts map[string]int
}
func CollectSessionToolMetrics ¶
func CollectSessionToolMetrics(sessions []conv.Session) []SessionToolMetrics
type SessionTurnMetrics ¶
type SessionTurnMetrics = conv.SessionTurnMetrics
func CollectSessionTurnMetrics ¶
func CollectSessionTurnMetrics(sessions []conv.Session) []SessionTurnMetrics
type Sessions ¶
type Sessions struct {
AverageDuration time.Duration
AverageMessages float64
UserMessageCount int
AssistantMessageCount int
UserAssistantRatio float64
AbandonedCount int
AbandonedRate float64
DurationHistogram []HistogramBucket
MessageHistogram []HistogramBucket
ClaudeTurnMetrics []PositionTokenMetrics
}
func ComputeSessions ¶
func ComputeSessions(sessions []conv.SessionMeta) Sessions
type Snapshot ¶
type Snapshot struct {
Overview Overview
Activity Activity
Sessions Sessions
Tools Tools
Cache Cache
Performance Performance
}
func ComputeSnapshot ¶
func ComputeSnapshot( conversations []conv.Conversation, timeRange TimeRange, sequence []PerformanceSequenceSession, ) Snapshot
func ComputeSnapshotWithPrecomputed ¶ added in v0.3.0
func ComputeSnapshotWithPrecomputed( conversations []conv.Conversation, timeRange TimeRange, sequence []conv.PerformanceSequenceSession, turnMetrics []conv.SessionTurnMetrics, dailyTokens []conv.ActivityBucketRow, ) Snapshot
type SplitDailyShare ¶ added in v0.4.0
type SplitDailyShare struct {
}
type SplitDailyValueSeries ¶ added in v0.4.0
type SplitDailyValueSeries struct {
Key string
Values []DailyValue
}
type SplitDimension ¶ added in v0.4.0
type SplitDimension int
const ( SplitDimensionNone SplitDimension = iota SplitDimensionProvider SplitDimensionVersion SplitDimensionModel SplitDimensionProject )
func (SplitDimension) IsActive ¶ added in v0.4.0
func (d SplitDimension) IsActive() bool
func (SplitDimension) Label ¶ added in v0.4.0
func (d SplitDimension) Label() string
func (SplitDimension) SessionKey ¶ added in v0.4.0
func (d SplitDimension) SessionKey(session conv.SessionMeta) string
func (SplitDimension) SupportsTurnMetrics ¶ added in v0.4.0
func (d SplitDimension) SupportsTurnMetrics() bool
func (SplitDimension) TurnMetricsKey ¶ added in v0.4.0
func (d SplitDimension) TurnMetricsKey(metrics conv.SessionTurnMetrics) string
type SplitHistogramBucket ¶ added in v0.4.0
type SplitHistogramBucket struct {
Label string
Total int
Splits []SplitValue
}
type SplitNamedStat ¶ added in v0.4.0
type SplitNamedStat struct {
Name string
Total int
Splits []SplitValue
}
type SplitRateStat ¶ added in v0.4.0
type SplitRateStat struct {
Name string
Count int
Total int
Rate float64
Splits []SplitValue
}
type SplitTurnSeries ¶ added in v0.4.0
type SplitTurnSeries struct {
Key string
Metrics []PositionTokenMetrics
}
func ComputeTurnTokenMetricsBySplit ¶ added in v0.4.0
func ComputeTurnTokenMetricsBySplit( sessions []SessionTurnMetrics, timeRange TimeRange, dim SplitDimension, allowed map[string]bool, mode StatisticMode, ) []SplitTurnSeries
type SplitValue ¶ added in v0.4.0
type StatisticMode ¶ added in v0.4.0
type StatisticMode int
const ( StatisticModeAverage StatisticMode = iota StatisticModeP50 StatisticModeP95 StatisticModeP99 StatisticModeMax StatisticModeTotal )
func NextStatisticMode ¶ added in v0.4.0
func NextStatisticMode(current StatisticMode, allowed []StatisticMode) StatisticMode
func (StatisticMode) BasisLabel ¶ added in v0.4.0
func (m StatisticMode) BasisLabel() string
func (StatisticMode) ShortLabel ¶ added in v0.4.0
func (m StatisticMode) ShortLabel() string
func (StatisticMode) TextLabel ¶ added in v0.4.0
func (m StatisticMode) TextLabel() string
type TokenTotals ¶
type TokenTrend ¶
type TokenTrend struct {
Direction TrendDirection
PercentChange int
}
func ComputeTokenTrend ¶
func ComputeTokenTrend(sessions []conv.SessionMeta, timeRange TimeRange) TokenTrend
func ComputeTokenTrendFromBuckets ¶ added in v0.3.0
func ComputeTokenTrendFromBuckets( activityBuckets []conv.ActivityBucketRow, timeRange TimeRange, ) TokenTrend
type ToolCategoryShare ¶
type ToolCategoryShare struct {
}
type ToolRateStat ¶
func ComputeToolErrorRates ¶
func ComputeToolErrorRates(sessions []conv.SessionMeta) []ToolRateStat
func ComputeToolRejectRates ¶
func ComputeToolRejectRates(sessions []SessionToolMetrics, timeRange TimeRange) []ToolRateStat
type Tools ¶
type Tools struct {
TotalCalls int
AverageCallsPerSession float64
ErrorRate float64
RejectionRate float64
TopTools []ToolStat
CallsPerSession []HistogramBucket
ToolErrorRates []ToolRateStat
ToolRejectRates []ToolRateStat
}
func ComputeTools ¶
func ComputeTools(sessions []conv.SessionMeta) Tools
func ComputeToolsFromSessionMetrics ¶
func ComputeToolsFromSessionMetrics(sessions []SessionToolMetrics, timeRange TimeRange) Tools
type ToolsBySplit ¶ added in v0.4.0
type ToolsBySplit struct {
CallsPerSession []SplitHistogramBucket
TopTools []SplitNamedStat
ToolErrorRates []SplitRateStat
ToolRejectRates []SplitRateStat
}
func ComputeToolsBySplit ¶ added in v0.4.0
func ComputeToolsBySplit( sessions []conv.SessionMeta, timeRange TimeRange, dim SplitDimension, allowed map[string]bool, ) ToolsBySplit
type TrendDirection ¶
type TrendDirection int
const ( TrendDirectionNone TrendDirection = iota TrendDirectionUp TrendDirectionDown TrendDirectionFlat )
type TurnTokens ¶
type TurnTokens = conv.TurnTokens
Source Files
¶
- activity.go
- activity_split.go
- cache.go
- cache_grouped.go
- cache_turn.go
- daily_tokens.go
- filter.go
- format.go
- grouped_helpers.go
- grouped_types.go
- grouping.go
- memory_write.go
- overview.go
- overview_trend.go
- performance.go
- performance_context.go
- performance_format.go
- performance_lane.go
- performance_messages.go
- performance_messages_collect.go
- performance_messages_metric.go
- performance_messages_reduce.go
- performance_metric.go
- performance_session.go
- performance_tokens.go
- performance_trend.go
- sessions.go
- snapshot.go
- split.go
- statistic_mode.go
- tools.go
- tools_grouped.go
- types.go
Click to show internal directories.
Click to hide internal directories.