-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(BA-615): Collect metrics for the RPC server #3555
base: main
Are you sure you want to change the base?
Conversation
6d265ad
to
f605742
Compare
f605742
to
6c3fe58
Compare
duration=duration, | ||
) | ||
return res | ||
except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about handling BaseException
here?
|
||
def __init__(self) -> None: | ||
self.functions = set() | ||
self._metric_observer = RPCMetricObserver.instance() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it used as a singleton object? Is it expected to use this observer in other context?
def _collect_metrics(observer: RPCMetricObserver) -> Callable: | ||
def decorator(meth: Callable) -> Callable[[AgentRPCServer, RPCMessage], Any]: | ||
@functools.wraps(meth) | ||
async def _inner(self: AgentRPCServer, *args, **kwargs) -> Any: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can apply more strict type hints here but then we have to update the type hints of RPCFunctionRegistry.__call__()
.
Let's leave it as a minor issue
resolves #3549 (BA-615)
Checklist: (if applicable)
ai.backend.test
docs
directory