[#356] Added pprof endpoint and working dir to service attributes
All checks were successful
DCO action / DCO (pull_request) Successful in 28s
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:
parent
b44705eb2f
commit
87afc4b58c
2 changed files with 12 additions and 0 deletions
|
@ -5,6 +5,7 @@ class ConfigAttributes:
|
|||
WALLET_CONFIG = "wallet_config"
|
||||
CONFIG_DIR = "service_config_dir"
|
||||
CONFIG_PATH = "config_path"
|
||||
WORKING_DIR = "working_dir"
|
||||
SHARD_CONFIG_PATH = "shard_config_path"
|
||||
LOGGER_CONFIG_PATH = "logger_config_path"
|
||||
LOCAL_WALLET_PATH = "local_wallet_path"
|
||||
|
@ -15,6 +16,7 @@ class ConfigAttributes:
|
|||
ENDPOINT_DATA_0_NS = "endpoint_data0_namespace"
|
||||
ENDPOINT_INTERNAL = "endpoint_internal0"
|
||||
ENDPOINT_PROMETHEUS = "endpoint_prometheus"
|
||||
ENDPOINT_PPROF = "endpoint_pprof"
|
||||
CONTROL_ENDPOINT = "control_endpoint"
|
||||
UN_LOCODE = "un_locode"
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue