fn calculate_topic_stat(
    stats: &VecDeque<HistoryTopicStat>,
    period: Duration,
) -> Option<CalculatedTopicStat>Expand description
Calculates the average record size for a topic within a specified time window based on recent merged statistics.
Returns Some(CalculatedTopicStat) if the calculation is successful, or None if insufficient data is available.