Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
class QueryStatisticsHandler(ControlHandler):
async def query_statistics(self, req: EmptyRequest) -> WorkerMetricsResponse:
state, state_version = self.context.state_manager.get_state_with_version()
# Refresh the cached counters before sampling them so a worker in the
# middle of a batch reports its in-progress work rather than the
# totals from the previous batch.
self.context.statistics_manager.refresh_counters()
metrics = WorkerMetrics(
worker_state=state,
worker_statistics=self.context.statistics_manager.get_statistics(),
Expand Down