Collecting metrics over discrete time intervals