forked from TrueCloudLab/frostfs-testlib
[#109] Update CSC with healthchecks
This commit is contained in:
parent
8ee2985c89
commit
e970fe2788
6 changed files with 158 additions and 78 deletions
|
@ -7,6 +7,7 @@ import yaml
|
|||
from frostfs_testlib.hosting.config import ServiceConfig
|
||||
from frostfs_testlib.hosting.interfaces import Host
|
||||
from frostfs_testlib.reporter import get_reporter
|
||||
from frostfs_testlib.shell.interfaces import CommandResult
|
||||
from frostfs_testlib.storage.constants import ConfigAttributes
|
||||
from frostfs_testlib.testing.readable import HumanReadableABC
|
||||
from frostfs_testlib.utils import wallet_utils
|
||||
|
@ -67,6 +68,12 @@ class NodeBase(HumanReadableABC):
|
|||
def service_healthcheck(self) -> bool:
|
||||
"""Service healthcheck."""
|
||||
|
||||
# TODO: Migrate to sub-class Metrcis (not yet exists :))
|
||||
def get_metric(self, metric: str) -> CommandResult:
|
||||
shell = self.host.get_shell()
|
||||
result = shell.exec(f"curl -s {self.get_metrics_endpoint()} | grep -e '^{metric}'")
|
||||
return result
|
||||
|
||||
def get_metrics_endpoint(self) -> str:
|
||||
return self._get_attribute(ConfigAttributes.ENDPOINT_PROMETHEUS)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue