- remove all ad-hoc classes: Remove APIServingTimingMixin, RequestTimingMetricsMixin, TimeStats. Unify to the new API.
- e.g. many time staus related in
ReqState:finished_time
- e.g. many time staus related in
- remove ad-hoc code in the critical path. e.g.,
# Record response sent time right before we send response.
if not state.response_sent_to_client_ts:
state.response_sent_to_client_ts = time.time()
out["meta_info"][
"response_sent_to_client_ts"
] = state.response_sent_to_client_ts
- all api comes from a single base class. ReqTimeStatsBase
- The data structure only records a list of monotonically increasing timestamps. People can do analysis (substraction) later.
- How to deal with
_calculate_timing_metrics. Move to the new dedicated file.
Success metrics:
- If we search for
time.time()ortime.perf_counter(). They only appear in a new file.