mirror of
https://github.com/logos-messaging/logos-delivery-js.git
synced 2026-05-18 05:19:36 +00:00
27 lines
688 B
TypeScript
27 lines
688 B
TypeScript
import { Protocols } from "./protocols.js";
|
|
|
|
export enum HealthStatus {
|
|
Unhealthy = "Unhealthy",
|
|
MinimallyHealthy = "MinimallyHealthy",
|
|
SufficientlyHealthy = "SufficientlyHealthy"
|
|
}
|
|
|
|
export interface IHealthManager {
|
|
getHealthStatus: () => HealthStatus;
|
|
getProtocolStatus: (protocol: Protocols) => ProtocolHealth | undefined;
|
|
updateProtocolHealth: (multicodec: string, connectedPeers: number) => void;
|
|
}
|
|
|
|
export type NodeHealth = {
|
|
overallStatus: HealthStatus;
|
|
protocolStatuses: ProtocolsHealthStatus;
|
|
};
|
|
|
|
export type ProtocolHealth = {
|
|
name: Protocols;
|
|
status: HealthStatus;
|
|
lastUpdate: Date;
|
|
};
|
|
|
|
export type ProtocolsHealthStatus = Map<Protocols, ProtocolHealth>;
|