pub struct ShortIntervalsInfo {
pub count: usize,
pub total_duration: Duration,
pub intervals: Vec<(usize, WorkInterval)>,
pub pauses_to_remove: Vec<usize>,
}Expand description
Information about short intervals detected in a workday.
This structure provides comprehensive analysis of work intervals that fall below the minimum duration threshold. It includes both statistical information about the impact of short intervals and actionable recommendations for optimization.
§Analysis Components
§Statistical Information
- Count: Number of short intervals detected
- Total Duration: Cumulative time spent in short work periods
- Individual Intervals: Specific intervals with their details
§Optimization Recommendations
- Pauses to Remove: Specific pauses that could be eliminated
- Merge Opportunities: Intervals that could be combined
- Productivity Impact: Potential time savings from optimization
§Usage Context
This analysis is used for:
- Generating optimization recommendations in reports
- Identifying patterns of work fragmentation
- Calculating potential productivity improvements
- Providing actionable feedback to users
Fields§
§count: usizeThe number of intervals that fall below the minimum duration threshold.
This count provides a quick assessment of work fragmentation:
- 0: No fragmentation issues detected
- 1-3: Minor fragmentation, limited impact
- 4+: Significant fragmentation, optimization recommended
total_duration: DurationThe cumulative duration of all short intervals combined.
Represents the total amount of time spent in fragmented work periods. This metric helps quantify the impact of work interruptions and provides context for optimization efforts.
§Impact Assessment
- < 30 minutes: Minor impact on overall productivity
- 30-60 minutes: Moderate impact, optimization beneficial
- > 60 minutes: Significant impact, optimization essential
intervals: Vec<(usize, WorkInterval)>Detailed information about each short interval detected.
Each tuple contains:
- Index: Position of the interval in the original collection
- WorkInterval: Complete interval data with timing information
This detailed information enables:
- Specific analysis of each fragmented period
- Identification of patterns in interruption timing
- Targeted recommendations for specific intervals
pauses_to_remove: Vec<usize>Indices of pauses that could be removed to merge short intervals.
These pause indices represent optimization opportunities where removing or consolidating breaks could create longer, more productive work intervals. The indices correspond to positions in the original pause collection.
§Optimization Strategy
- Pause Removal: Eliminate unnecessary short breaks
- Pause Consolidation: Combine multiple short breaks into fewer, longer ones
- Timing Adjustment: Shift break timing to create better work blocks
§Implementation Notes
To remove a short interval, remove the pause that created it by separating it from the previous interval. This effectively merges the short interval with its predecessor.