| edition = "2023"; |
| |
| package milotic_tlbmc; |
| |
| import "google/protobuf/timestamp.proto"; |
| |
| // Enum representing the status of a service. |
| enum ServiceStatus { |
| SERVICE_STATUS_UNKNOWN = 0; // Default value or unit file not found. |
| SERVICE_STATUS_ACTIVE = 1; // The service is running. |
| SERVICE_STATUS_INACTIVE = 2; // The service is stopped or completed. |
| SERVICE_STATUS_FAILED = |
| 3; // The service encountered an error during execution. |
| SERVICE_STATUS_NOT_FOUND = 4; // The service unit file does not exist. |
| } |
| |
| // Represents whether True Hitless package is activated and the checksum is |
| // valid. |
| message ActivationState { |
| bool activated = 1; |
| // Whether the checksum of the True Hitless package is valid, indicating a |
| // successful True Hitless install. |
| bool image_checksum_valid = 2; |
| } |
| |
| // State of the eMMC, including the current status and the time it took for the |
| // eMMC to become available. |
| message EmmcStatus { |
| ServiceStatus status = 1; |
| int64 time_to_active_seconds = 2; |
| } |
| |
| // Track the status of the two eMMC targets, available_target_status if the eMMC |
| // becomes available and unavailable_target_status if it does not. |
| message EmmcAvailabilityTargets { |
| EmmcStatus available_target_status = 1; |
| EmmcStatus unavailable_target_status = 2; |
| } |
| |
| // Track the status of an intermediate service, including the name of the |
| // service, the status of the service, the last executed timestamp, and whether |
| // the postprocessing is complete. |
| message IntermediateServiceStatus { |
| string name = 1; |
| ServiceStatus status = 2; |
| google.protobuf.Timestamp last_execution_time = 3; |
| // Two of the intermediate services are expected to have postprocessing: |
| // emmc_available_postprocessing_service and |
| // emmc_unavailable_postprocessing_service |
| bool postprocessing_complete = 4; |
| } |
| |
| // Tracks the status of the three intermediate services: |
| // true_hitless_initialize_service, emmc_available_postprocessing_service, and |
| // emmc_unavailable_postprocessing_service. |
| message IntermediateState { |
| repeated IntermediateServiceStatus intermediate_service_statuses = 1; |
| } |
| |
| // Tracks the status of a service managed by True Hitless as listed in |
| // /var/google/true-hitless/true-hitless-service-list.txt |
| message ManagedServiceState { |
| string name = 1; |
| // Indicates if block-override.conf is applied to this service. |
| bool block_override_applied = 2; |
| // Indicates if emmc-override.conf is applied to this service. |
| bool emmc_override_applied = 3; |
| ServiceStatus status = 4; |
| // Indicates if the binary is running on eMMC due to a True Hitless install, |
| // overriding the default service file. |
| bool binary_running_on_emmc = 5; |
| // Number of automatic restarts triggered by systemd's Restart= policy since |
| // boot. Resets to 0 on manual restart or reboot. |
| int64 restart_count = 6; |
| // Number of times the service has crashed and generated a coredump since |
| // boot. Persist across service restart but resets on reboot. |
| int64 coredump_count = 7; |
| // Time in ms of ActiveEnterTimestamp - InactiveEnterTimestamp. This is the |
| // downtime of the service after TH install. |
| int64 restart_time_ms = 8; |
| } |
| |
| // Multiple services can be managed by True Hitless. |
| message ManagedServices { |
| repeated ManagedServiceState service_states = 1; |
| } |
| |
| // Tracks the version of the True Hitless package and gBMC firmware. |
| message VersionState { |
| string true_hitless_version = 1; |
| string gbmc_version = 2; |
| // Indicates if True-Hitless version is compatible with firmware version |
| bool compatible = 3; |
| } |
| |
| // Aggregated proto for all True Hitless metrics. |
| message TrueHitlessMetrics { |
| ActivationState activation_state = 1; |
| EmmcAvailabilityTargets emmc_availability_targets = 2; |
| IntermediateState intermediate_state = 3; |
| ManagedServices managed_services = 4; |
| VersionState version_state = 5; |
| google.protobuf.Timestamp last_updated_timestamp = 6; |
| string error_message = 7; |
| } |