← Back to the chapter · Next detail →

Technical detail · Edge Processing: Aggregation Decisions

What the aggregation function returns

# Example: Statistical aggregation
import statistics

def aggregate_window(readings, window_minutes=60):
    return {
        "min": min(readings),
        "max": max(readings),
        "avg": sum(readings) / len(readings),
        "stddev": statistics.stdev(readings),
        "count": len(readings),
        "window_end": now()
    }

← Back to the chapter · Next detail →