mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-01-20 00:43:10 +00:00
* feat: introduce HealthManager * feat: make health accessible on Waku object * feat: update health from protocols * chore: add access modifiers to healthmanager * feat: use a HealthManager singleton * chore: add tests for Filter, LightPush and Store * feat: add overall node health * chore: update protocol health to consider Store protocol * chore: setup generic test utils instead of using filter utils * tests: add a health status matrix check from 0-3 * chore: increase timeout for failing tests in CI tests pass locally without an increased timeout, but fail in CI * chore: move name inference to HealthManager * tests: abstract away node creation and teardown utils * fix: import
27 lines
685 B
TypeScript
27 lines
685 B
TypeScript
import { Protocols } from "./protocols";
|
|
|
|
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>;
|