Documentation
¶
Overview ¶
Package perfprofile analyzes timing data from task checkpoints and the cost ledger to identify execution bottlenecks across a plan run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderBottleneckTable ¶
RenderBottleneckTable writes a ranked bottleneck table to w. top limits the number of tasks shown (0 = show all).
func RenderHistogram ¶
RenderHistogram writes an ASCII histogram of task duration distribution to w.
Types ¶
type Profile ¶
type Profile struct {
Tasks []*TaskProfile
Providers map[string]*ProviderProfile
// Plan-level span
PlanStartedAt *time.Time
PlanCompletedAt *time.Time
// TotalWallSpan is latest CompletedAt minus earliest StartedAt across all tasks.
TotalWallSpan time.Duration
// SumTaskDurations is the arithmetic sum of every task's WallTime.
SumTaskDurations time.Duration
// ParallelEfficiency = SumTaskDurations / TotalWallSpan.
// Values > 1.0 indicate parallelism was used. 1.0 means purely sequential.
ParallelEfficiency float64
// Task duration distribution
MeanTaskDuration time.Duration
P95TaskDuration time.Duration
MaxTaskDuration time.Duration
// Durations contains every non-zero task WallTime, sorted ascending (for histogram).
Durations []time.Duration
// MeanQueueDelay is the mean wait time tasks spend queued between executions.
MeanQueueDelay time.Duration
// TotalQueueDelay is the sum of all queue delays.
TotalQueueDelay time.Duration
}
Profile is the complete performance analysis result.
type ProviderProfile ¶
type ProviderProfile struct {
Provider string
// TotalCalls is the number of cost-ledger entries attributed to this provider.
TotalCalls int
// Latencies are per-step elapsed-second deltas derived from checkpoint history.
Latencies []float64
MeanSec float64
P95Sec float64
MaxSec float64
TotalInputTokens int
TotalOutputTokens int
TotalCostUSD float64
}
ProviderProfile aggregates latency and usage stats for one provider+model pair.
type TaskProfile ¶
type TaskProfile struct {
TaskID int
TaskTitle string
Status string
WallTime time.Duration
StartedAt *time.Time
CompletedAt *time.Time
// QueueDelay is the gap between the previous task completing and this one starting.
QueueDelay time.Duration
Provider string
Model string
InputTokens int
OutputTokens int
CostUSD float64
}
TaskProfile holds performance data for a single task execution.
Click to show internal directories.
Click to hide internal directories.