Metrics Export Service (#7809)

This commit is contained in:
SangBin Cho
2020-03-30 23:28:32 -07:00
committed by GitHub
parent bfb9248532
commit c23e56ce9a
15 changed files with 1039 additions and 286 deletions
+4 -4
View File
@@ -85,10 +85,10 @@ class RayServeHandle:
# If both the slo's are None then then we use a high default
# value so other queries can be prioritize and put in front of these
# queries.
assert not all(absolute_slo_ms,
relative_slo_ms), ("Can't specify both "
"relative and absolute "
"slo's together!")
assert not all([absolute_slo_ms, relative_slo_ms
]), ("Can't specify both "
"relative and absolute "
"slo's together!")
# Don't override existing method
if method_name is None and self.method_name is not None:
+8 -7
View File
@@ -113,15 +113,16 @@ class RayServeMixin:
"which is specified in the request. "
"The avaiable methods are {}".format(
method_name, dir(self)))
if method_name != "__call__":
return getattr(self, method_name)
else:
# For simple callables, we should just return the object so
# signature recoding will continue to funciton.
return self
return getattr(self, method_name)
def _ray_serve_count_num_positional(self, f):
# NOTE:
# In the case of simple functions, not actors, the f will be
# a TaskRunner.__call__. What we really want here is the wrapped
# functionso inspect.signature will figure out the underlying f.
if hasattr(self, "__wrapped__"):
f = self.__wrapped__
signature = inspect.signature(f)
counter = 0
for param in signature.parameters.values():