pub struct HealthCheckManager {
ServiceHealth: Arc<RwLock<HashMap<String, ServiceHealth>>>,
HealthHistory: Arc<RwLock<Vec<HealthCheckRecord>>>,
RecoveryActions: Arc<RwLock<HashMap<String, RecoveryAction>>>,
config: HealthCheckConfig,
}Expand description
Health check manager
Fields§
§ServiceHealth: Arc<RwLock<HashMap<String, ServiceHealth>>>Service health status
HealthHistory: Arc<RwLock<Vec<HealthCheckRecord>>>Health check history
RecoveryActions: Arc<RwLock<HashMap<String, RecoveryAction>>>Recovery actions
config: HealthCheckConfigHealth check configuration
Implementations§
Source§impl HealthCheckManager
impl HealthCheckManager
Sourcepub fn new(config: Option<HealthCheckConfig>) -> Self
pub fn new(config: Option<HealthCheckConfig>) -> Self
Create a new HealthCheckManager instance
Sourcepub async fn RegisterService(
&self,
ServiceName: String,
CheckLevel: HealthCheckLevel,
) -> Result<()>
pub async fn RegisterService( &self, ServiceName: String, CheckLevel: HealthCheckLevel, ) -> Result<()>
Register a service for health monitoring
Sourcepub async fn CheckService(&self, ServiceName: &str) -> Result<HealthStatus>
pub async fn CheckService(&self, ServiceName: &str) -> Result<HealthStatus>
Perform health check for a service
Sourceasync fn CheckAuthenticationService(&self) -> (HealthStatus, Option<String>)
async fn CheckAuthenticationService(&self) -> (HealthStatus, Option<String>)
Check authentication service health
Sourceasync fn CheckUpdatesService(&self) -> (HealthStatus, Option<String>)
async fn CheckUpdatesService(&self) -> (HealthStatus, Option<String>)
Check updates service health
Sourceasync fn CheckDownloaderService(&self) -> (HealthStatus, Option<String>)
async fn CheckDownloaderService(&self) -> (HealthStatus, Option<String>)
Check downloader service health
Sourceasync fn CheckIndexingService(&self) -> (HealthStatus, Option<String>)
async fn CheckIndexingService(&self) -> (HealthStatus, Option<String>)
Check indexing service health
Sourceasync fn CheckgRPCService(&self) -> (HealthStatus, Option<String>)
async fn CheckgRPCService(&self) -> (HealthStatus, Option<String>)
Check gRPC service health
Sourceasync fn CheckConnectionsService(&self) -> (HealthStatus, Option<String>)
async fn CheckConnectionsService(&self) -> (HealthStatus, Option<String>)
Check connections service health
Sourceasync fn UpdateServiceHealth(
&self,
ServiceName: &str,
status: HealthStatus,
ErrorMessage: &Option<String>,
ResponseTime: u64,
) -> Result<()>
async fn UpdateServiceHealth( &self, ServiceName: &str, status: HealthStatus, ErrorMessage: &Option<String>, ResponseTime: u64, ) -> Result<()>
Update service health status
Sourceasync fn RecordHealthCheck(
&self,
ServiceName: &str,
status: HealthStatus,
ResponseTime: u64,
ErrorMessage: &Option<String>,
)
async fn RecordHealthCheck( &self, ServiceName: &str, status: HealthStatus, ResponseTime: u64, ErrorMessage: &Option<String>, )
Record health check in history
Sourceasync fn TriggerRecoveryIfNeeded(&self, ServiceName: &str)
async fn TriggerRecoveryIfNeeded(&self, ServiceName: &str)
Trigger recovery actions if needed
Sourceasync fn HandleResponseTimeRecovery(&self, ServiceName: &str, ResponseTime: u64)
async fn HandleResponseTimeRecovery(&self, ServiceName: &str, ResponseTime: u64)
Handle response time-based recovery
Sourceasync fn HandleCriticalAlerts(&self, ServiceName: &str, status: &HealthStatus)
async fn HandleCriticalAlerts(&self, ServiceName: &str, status: &HealthStatus)
Handle critical health alerts
Sourceasync fn PerformRecoveryAction(&self, ServiceName: &str)
async fn PerformRecoveryAction(&self, ServiceName: &str)
Perform recovery action for a service
Sourceasync fn RestartAuthenticationService(&self) -> Result<()>
async fn RestartAuthenticationService(&self) -> Result<()>
Restart authentication service
Sourceasync fn RestartUpdatesService(&self) -> Result<()>
async fn RestartUpdatesService(&self) -> Result<()>
Restart updates service
Sourceasync fn RestartDownloaderService(&self) -> Result<()>
async fn RestartDownloaderService(&self) -> Result<()>
Restart downloader service
Sourceasync fn RestartIndexingService(&self) -> Result<()>
async fn RestartIndexingService(&self) -> Result<()>
Restart indexing service
Sourceasync fn RestartgRPCService(&self) -> Result<()>
async fn RestartgRPCService(&self) -> Result<()>
Restart gRPC service
Sourceasync fn ResetConnectionsService(&self) -> Result<()>
async fn ResetConnectionsService(&self) -> Result<()>
Reset connections service
Sourcepub async fn GetOverallHealth(&self) -> HealthStatus
pub async fn GetOverallHealth(&self) -> HealthStatus
Get overall daemon health status
Sourcepub async fn GetServiceHealth(
&self,
service_name: &str,
) -> Option<ServiceHealth>
pub async fn GetServiceHealth( &self, service_name: &str, ) -> Option<ServiceHealth>
Get service health status
Sourcepub async fn GetHealthHistory(
&self,
service_name: Option<&str>,
limit: Option<usize>,
) -> Vec<HealthCheckRecord>
pub async fn GetHealthHistory( &self, service_name: Option<&str>, limit: Option<usize>, ) -> Vec<HealthCheckRecord>
Get health check history
Sourcepub async fn RegisterRecoveryAction(&self, action: RecoveryAction) -> Result<()>
pub async fn RegisterRecoveryAction(&self, action: RecoveryAction) -> Result<()>
Register a recovery action
Sourcepub async fn GetHealthStatistics(&self) -> HealthStatistics
pub async fn GetHealthStatistics(&self) -> HealthStatistics
Get health statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HealthCheckManager
impl !RefUnwindSafe for HealthCheckManager
impl Send for HealthCheckManager
impl Sync for HealthCheckManager
impl Unpin for HealthCheckManager
impl !UnwindSafe for HealthCheckManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].