Implement a statistics HTTP server

This is incorrect. If there are no samples, then this will not produce a new bucket. A new bucket should always be produced, even if there are no samples (it means nothing was collected in the period).