forked from TrueCloudLab/frostfs-testlib
[#248] add metrics methods
This commit is contained in:
parent
f1b2fbd47b
commit
da16f3c3a5
2 changed files with 50 additions and 5 deletions
|
@ -16,11 +16,6 @@ class StorageMetrics:
|
|||
self.host = host
|
||||
self.metrics_endpoint = metrics_endpoint
|
||||
|
||||
def get_metric_container(self, metric: str, cid: str) -> CommandResult:
|
||||
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.
|
||||
|
@ -34,3 +29,8 @@ class StorageMetrics:
|
|||
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
|
||||
|
||||
def get_all_metrics(self) -> CommandResult:
|
||||
shell = self.host.get_shell()
|
||||
result = shell.exec(f"curl -s {self.metrics_endpoint}")
|
||||
return result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue