mirror of
https://github.com/wassname/ray.git
synced 2026-07-19 11:27:32 +08:00
[Serve] Implement metric interface (#5852)
* Implement metric interface * Address comment: made actor_handles a dict * Fix iteration * Lint * Mark lightweight actors as num_cpus=0 to prevent resource starvation * Be more explicit about the readiness condition * Make task_runner non-blocking * Lint
This commit is contained in:
@@ -76,6 +76,18 @@ class CentralizedQueues:
|
||||
# backend_name -> worker queue
|
||||
self.workers = defaultdict(deque)
|
||||
|
||||
def is_ready(self):
|
||||
return True
|
||||
|
||||
def _serve_metric(self):
|
||||
return {
|
||||
"service_{}_queue_size".format(service_name): {
|
||||
"value": len(queue),
|
||||
"type": "counter",
|
||||
}
|
||||
for service_name, queue in self.queues.items()
|
||||
}
|
||||
|
||||
def enqueue_request(self, service, request_args, request_kwargs,
|
||||
request_context):
|
||||
query = Query(request_args, request_kwargs, request_context)
|
||||
|
||||
Reference in New Issue
Block a user