LLM serving dashboards track:
(last - first) / (n_tokens - 1), undefined for a single tokenEach request is (start_time, token_times) in seconds. Implement:
request_metrics(start, token_times): a dict with ttft, tpot (None for one token) and itl (a list)summarise(requests, percentiles=(50, 95, 99)): a dict with ttft_p<k> and itl_p<k> for each percentile (pooling the ITL gaps from all requests, using np.percentile) and throughput: total tokens divided by the span from the earliest start to the latest token