From eb997c5a4089ae0fc7542e1fd2369e60c597ffdf Mon Sep 17 00:00:00 2001 From: Topilski Date: Sun, 13 Oct 2024 09:01:03 +0300 Subject: [PATCH] Sync stat with PRO --- .../commands_info/service/server_info.cpp | 23 +++++++++++++++++-- .../commands_info/service/server_info.h | 6 +++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/server/daemon/commands_info/service/server_info.cpp b/src/server/daemon/commands_info/service/server_info.cpp index 5b8de1e..63aa2d5 100644 --- a/src/server/daemon/commands_info/service/server_info.cpp +++ b/src/server/daemon/commands_info/service/server_info.cpp @@ -26,6 +26,9 @@ #define CODS_HOST_FIELD "cods_host" #define EXPIRATION_TIME_FIELD "expiration_time" +#define VSYSTEM_FIELD "vsystem" +#define VROLE_FIELD "vrole" + #define HLS_DIR_FIELD "hls_dir" #define VODS_DIR_FIELD "vods_dir" #define CODS_DIR_FIELD "cods_dir" @@ -148,7 +151,9 @@ FullServiceInfo::FullServiceInfo() http_host_(), project_(PROJECT_NAME_LOWERCASE), proj_ver_(PROJECT_VERSION_HUMAN), - os_(fastotv::commands_info::OperationSystemInfo::MakeOSSnapshot()) {} + os_(fastotv::commands_info::OperationSystemInfo::MakeOSSnapshot()), + vsystem_(), + vrole_() {} FullServiceInfo::FullServiceInfo(const host_t& http_host, const host_t& vods_host, @@ -176,7 +181,9 @@ FullServiceInfo::FullServiceInfo(const host_t& http_host, data_dir_(data_dir), project_(PROJECT_NAME_LOWERCASE), proj_ver_(PROJECT_VERSION_HUMAN), - os_(fastotv::commands_info::OperationSystemInfo::MakeOSSnapshot()) {} + os_(fastotv::commands_info::OperationSystemInfo::MakeOSSnapshot()), + vsystem_(), + vrole_() {} FullServiceInfo::host_t FullServiceInfo::GetHttpHost() const { return http_host_; @@ -198,6 +205,14 @@ std::string FullServiceInfo::GetProjectVersion() const { return proj_ver_; } +std::string FullServiceInfo::GetVsystem() const { + return vsystem_; +} + +std::string FullServiceInfo::GetVrole() const { + return vrole_; +} + common::Error FullServiceInfo::DoDeSerialize(json_object* serialized) { FullServiceInfo inf; common::Error err = inf.base_class::DoDeSerialize(serialized); @@ -241,6 +256,8 @@ common::Error FullServiceInfo::DoDeSerialize(json_object* serialized) { ignore_result(GetStringField(serialized, DATA_DIR_FIELD, &inf.data_dir_)); ignore_result(GetStringField(serialized, PROJECT_FIELD, &inf.project_)); ignore_result(GetStringField(serialized, VERSION_FIELD, &inf.proj_ver_)); + ignore_result(GetStringField(serialized, VSYSTEM_FIELD, &inf.vsystem_)); + ignore_result(GetStringField(serialized, VROLE_FIELD, &inf.vrole_)); *this = inf; return common::Error(); @@ -269,6 +286,8 @@ common::Error FullServiceInfo::SerializeFields(json_object* out) const { ignore_result(SetStringField(out, VERSION_FIELD, proj_ver_)); ignore_result(SetStringField(out, PROJECT_FIELD, project_)); ignore_result(SetObjectField(out, OS_FIELD, jos)); + ignore_result(SetStringField(out, VSYSTEM_FIELD, vsystem_)); + ignore_result(SetStringField(out, VROLE_FIELD, vrole_)); return base_class::SerializeFields(out); } diff --git a/src/server/daemon/commands_info/service/server_info.h b/src/server/daemon/commands_info/service/server_info.h index c570d27..2c6ec5e 100644 --- a/src/server/daemon/commands_info/service/server_info.h +++ b/src/server/daemon/commands_info/service/server_info.h @@ -96,6 +96,9 @@ class FullServiceInfo : public ServerInfo { std::string GetProject() const; std::string GetProjectVersion() const; + std::string GetVsystem() const; + std::string GetVrole() const; + protected: common::Error DoDeSerialize(json_object* serialized) override; common::Error SerializeFields(json_object* out) const override; @@ -117,6 +120,9 @@ class FullServiceInfo : public ServerInfo { std::string project_; std::string proj_ver_; fastotv::commands_info::OperationSystemInfo os_; + + std::string vsystem_; + std::string vrole_; }; } // namespace service