mirror of https://github.com/milvus-io/milvus.git
[skip ci] Add rps on benchmark (#9486)
Signed-off-by: wangting0128 <ting.wang@zilliz.com>pull/9497/head
parent
711031640f
commit
0b3c182f14
|
@ -45,10 +45,15 @@ def time_wrapper(func):
|
|||
# logger.debug("Milvus {} start".format(func.__name__))
|
||||
log = kwargs.get("log", True)
|
||||
kwargs.pop("log", None)
|
||||
rps = kwargs.get("rps", False)
|
||||
kwargs.pop("rps", None)
|
||||
result = func(*args, **kwargs)
|
||||
end = time.time()
|
||||
if log:
|
||||
logger.debug("Milvus {} run in {}s".format(func.__name__, round(end - start, 2)))
|
||||
_rps = round(end - start, 2)
|
||||
logger.debug("Milvus {} run in {}s".format(func.__name__, _rps))
|
||||
if rps is not False:
|
||||
return result, _rps
|
||||
return result
|
||||
|
||||
return wrapper
|
||||
|
|
Loading…
Reference in New Issue