[#356] Added pprof endpoint and working dir to service attributes

Signed-off-by: Dmitry Anurin <danurin@yadro.com>
This commit is contained in:
Dmitry Anurin 2025-02-04 10:03:58 +03:00
parent b44705eb2f
commit 87afc4b58c
2 changed files with 12 additions and 0 deletions

View file

@ -82,6 +82,9 @@ class NodeBase(HumanReadableABC):
def get_metrics_endpoint(self) -> str:
return self._get_attribute(ConfigAttributes.ENDPOINT_PROMETHEUS)
def get_pprof_endpoint(self) -> str:
return self._get_attribute(ConfigAttributes.ENDPOINT_PPROF)
def stop_service(self, mask: bool = True):
if mask:
with reporter.step(f"Mask {self.name} service on {self.host.config.address}"):
@ -144,6 +147,13 @@ class NodeBase(HumanReadableABC):
else None
)
def get_working_dir_path(self) -> Optional[str]:
"""
Returns working directory path located on remote host
"""
config_attributes = self.host.get_service_config(self.name)
return self._get_attribute(ConfigAttributes.WORKING_DIR) if ConfigAttributes.WORKING_DIR in config_attributes.attributes else None
@property
def config_dir(self) -> str:
return self._get_attribute(ConfigAttributes.CONFIG_DIR)