sync code

This commit is contained in:
Ned Wright
2024-09-15 02:49:26 +00:00
parent f4bad4c4d9
commit eddd250409
48 changed files with 368 additions and 174 deletions

View File

@@ -35,6 +35,8 @@ enum class UpdatesFailureReason {
INSTALL_PACKAGE,
CHECKSUM_UNMATCHED,
POLICY_CONFIGURATION,
SERVISE_CONFIGURATION,
SERVISE_CONFIGURATION_TIMEOUT,
POLICY_FOG_CONFIGURATION,
NONE
@@ -57,6 +59,8 @@ convertUpdatesFailureReasonToStr(UpdatesFailureReason reason)
case UpdatesFailureReason::INSTALL_PACKAGE : return "INSTALL_PACKAGE";
case UpdatesFailureReason::CHECKSUM_UNMATCHED : return "CHECKSUM_UNMATCHED";
case UpdatesFailureReason::POLICY_CONFIGURATION : return "POLICY_CONFIGURATION";
case UpdatesFailureReason::SERVISE_CONFIGURATION : return "SERVISE_CONFIGURATION";
case UpdatesFailureReason::SERVISE_CONFIGURATION_TIMEOUT : return "SERVISE_CONFIGURATION_TIMEOUT";
case UpdatesFailureReason::POLICY_FOG_CONFIGURATION : return "POLICY_FOG_CONFIGURATION";
case UpdatesFailureReason::NONE : return "NONE";
}

View File

@@ -21,20 +21,24 @@
#include "config.h"
#include "debug.h"
#include "i_orchestration_status.h"
#include "i_service_controller.h"
#include "health_check_status/health_check_status.h"
#include "updates_process_event.h"
#include "updates_process_report.h"
class UpdatesProcessReporter : public Listener<UpdatesProcessEvent>
class UpdatesProcessReporter
:
public Listener<UpdatesProcessEvent>,
Singleton::Consume<I_ServiceController>
{
public:
void upon(const UpdatesProcessEvent &event) override;
private:
void sendReoprt();
void sendReoprt(const std::string &version);
static std::vector<UpdatesProcessReport> reports;
uint report_failure_count = 0;
std::map<std::string, uint> report_failure_count_map;
};
#endif // __UPDATES_PROCESS_REPORTER_H__