[#356] Added pprof endpoint and working dir to service attributes
All checks were successful
DCO action / DCO (pull_request) Successful in 28s

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

@ -5,6 +5,7 @@ class ConfigAttributes:
WALLET_CONFIG = "wallet_config" WALLET_CONFIG = "wallet_config"
CONFIG_DIR = "service_config_dir" CONFIG_DIR = "service_config_dir"
CONFIG_PATH = "config_path" CONFIG_PATH = "config_path"
WORKING_DIR = "working_dir"
SHARD_CONFIG_PATH = "shard_config_path" SHARD_CONFIG_PATH = "shard_config_path"
LOGGER_CONFIG_PATH = "logger_config_path" LOGGER_CONFIG_PATH = "logger_config_path"
LOCAL_WALLET_PATH = "local_wallet_path" LOCAL_WALLET_PATH = "local_wallet_path"
@ -15,6 +16,7 @@ class ConfigAttributes:
ENDPOINT_DATA_0_NS = "endpoint_data0_namespace" ENDPOINT_DATA_0_NS = "endpoint_data0_namespace"
ENDPOINT_INTERNAL = "endpoint_internal0" ENDPOINT_INTERNAL = "endpoint_internal0"
ENDPOINT_PROMETHEUS = "endpoint_prometheus" ENDPOINT_PROMETHEUS = "endpoint_prometheus"
ENDPOINT_PPROF = "endpoint_pprof"
CONTROL_ENDPOINT = "control_endpoint" CONTROL_ENDPOINT = "control_endpoint"
UN_LOCODE = "un_locode" UN_LOCODE = "un_locode"

View file

@ -82,6 +82,9 @@ class NodeBase(HumanReadableABC):
def get_metrics_endpoint(self) -> str: def get_metrics_endpoint(self) -> str:
return self._get_attribute(ConfigAttributes.ENDPOINT_PROMETHEUS) 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): def stop_service(self, mask: bool = True):
if mask: if mask:
with reporter.step(f"Mask {self.name} service on {self.host.config.address}"): with reporter.step(f"Mask {self.name} service on {self.host.config.address}"):
@ -144,6 +147,13 @@ class NodeBase(HumanReadableABC):
else None 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 @property
def config_dir(self) -> str: def config_dir(self) -> str:
return self._get_attribute(ConfigAttributes.CONFIG_DIR) return self._get_attribute(ConfigAttributes.CONFIG_DIR)