Documentation
¶
Overview ¶
Package analytics provides velocity and forecasting analytics for project planning.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BurndownPoint ¶
type BurndownPoint struct {
Date time.Time // Date of this data point
Actual int // Actual remaining tasks (historical data)
Projected int // Projected remaining tasks (forecast)
}
BurndownPoint represents a single point on a burndown chart.
func (BurndownPoint) IsProjected ¶
func (bp BurndownPoint) IsProjected() bool
IsProjected returns true if this point is a forecast rather than actual data.
type ConfidenceInterval ¶
type ConfidenceInterval struct {
Low float64 // Pessimistic estimate (e.g., 10th percentile)
Expected float64 // Most likely estimate (e.g., 50th percentile)
High float64 // Optimistic estimate (e.g., 90th percentile)
}
ConfidenceInterval represents low/expected/high estimates for forecasting.
func (ConfidenceInterval) IsNarrow ¶
func (ci ConfidenceInterval) IsNarrow() bool
IsNarrow returns true if the confidence interval is relatively tight.
func (ConfidenceInterval) Range ¶
func (ci ConfidenceInterval) Range() float64
Range returns the difference between high and low estimates.
type ForecastResult ¶
type ForecastResult struct {
// Core metrics
RemainingTasks int // Number of tasks remaining
CompletedTasks int // Number of tasks completed
TotalTasks int // Total tasks in plan
Velocity float64 // Current velocity (tasks/day)
// Time estimates
EstimatedDays float64 // Expected days to completion
ConfidenceInterval ConfidenceInterval // Low/Expected/High day estimates
// Trend analysis
Trend VelocityTrend // Velocity trend over time windows
// Burndown data
Burndown []BurndownPoint // Historical and projected burndown
// Additional context
LastUpdated time.Time // When this forecast was generated
DataPoints int // Number of data points used for calculation
}
ForecastResult contains comprehensive forecasting data.
func (ForecastResult) CompletionRate ¶
func (f ForecastResult) CompletionRate() float64
CompletionRate returns the percentage of tasks completed.
func (ForecastResult) EstimatedCompletionDate ¶
func (f ForecastResult) EstimatedCompletionDate() time.Time
EstimatedCompletionDate returns the projected completion date.
func (ForecastResult) IsOnTrack ¶
func (f ForecastResult) IsOnTrack() bool
IsOnTrack returns true if current velocity supports estimated completion.
type TaskCycleTime ¶
type TaskCycleTime struct {
TaskID string // ID of the task
TotalTime time.Duration // Total time from pending to done
WaitTime time.Duration // Time spent in pending/blocked
WorkTime time.Duration // Time spent in progress
StartedAt time.Time // When task moved to in_progress
CompletedAt time.Time // When task moved to done
}
TaskCycleTime tracks how long tasks spend in each status.
func (TaskCycleTime) Efficiency ¶
func (tc TaskCycleTime) Efficiency() float64
Efficiency returns the ratio of work time to total time.
type TrendDirection ¶
type TrendDirection string
TrendDirection indicates the direction of velocity change over time.
const ( // TrendAccelerating indicates velocity is increasing. TrendAccelerating TrendDirection = "accelerating" // TrendDecelerating indicates velocity is decreasing. TrendDecelerating TrendDirection = "decelerating" // TrendStable indicates velocity is relatively constant. TrendStable TrendDirection = "stable" )
type VelocityStats ¶
type VelocityStats struct {
Mean float64 // Average velocity
Median float64 // Median velocity
StdDev float64 // Standard deviation
Min float64 // Minimum observed velocity
Max float64 // Maximum observed velocity
Samples int // Number of samples
}
VelocityStats holds statistical summary of velocity data.
func (VelocityStats) IsConsistent ¶
func (vs VelocityStats) IsConsistent() bool
IsConsistent returns true if velocity is relatively stable.
func (VelocityStats) Variability ¶
func (vs VelocityStats) Variability() float64
Variability returns the coefficient of variation (StdDev/Mean).
type VelocityTrend ¶
type VelocityTrend struct {
Direction TrendDirection // Overall trend direction
Slope float64 // Rate of change (positive = accelerating)
Confidence float64 // Confidence level of the trend (0.0-1.0)
Windows []VelocityWindow // Velocity data per time window
}
VelocityTrend captures the trend analysis of velocity over multiple time windows.
func (VelocityTrend) IsNegative ¶
func (t VelocityTrend) IsNegative() bool
IsNegative returns true if the trend indicates declining velocity.
func (VelocityTrend) IsPositive ¶
func (t VelocityTrend) IsPositive() bool
IsPositive returns true if the trend indicates improving velocity.
type VelocityWindow ¶
type VelocityWindow struct {
Days int // Number of days in this window (e.g., 7, 14, 30)
Velocity float64 // Tasks completed per day in this window
Count int // Number of tasks completed in this window
}
VelocityWindow represents velocity calculated over a specific time window.