[#228] metrics for object
Some checks reported warnings
DCO action / DCO (pull_request) Has been cancelled
Some checks reported warnings
DCO action / DCO (pull_request) Has been cancelled
This commit is contained in:
parent
b8ce75b299
commit
659f78bd28
1 changed files with 14 additions and 0 deletions
|
@ -20,3 +20,17 @@ class StorageMetrics:
|
|||
shell = self.host.get_shell()
|
||||
result = shell.exec(f"curl -s {self.metrics_endpoint} | grep {metric} |grep {cid}")
|
||||
return result
|
||||
|
||||
def get_metrics_search_by_greps(self, **greps) -> CommandResult:
|
||||
"""
|
||||
Get a metrics, search by: cid, metric_type, shard_id etc.
|
||||
Args:
|
||||
greps: dict of grep-command-name and value
|
||||
for example get_metrics_search_by_greps(command='container_objects_total', cid='123456')
|
||||
Return:
|
||||
result of metrics
|
||||
"""
|
||||
shell = self.host.get_shell()
|
||||
additional_greps = " |grep ".join([grep_command for grep_command in greps.values()])
|
||||
result = shell.exec(f"curl -s {self.metrics_endpoint} | grep {additional_greps}")
|
||||
return result
|
||||
|
|
Loading…
Reference in a new issue