Skip to main content

Abstract Class: MonitorServiceAdapterBase<TType>

Defined in: electron/services/monitoring/shared/monitorServiceAdapterBase.ts:28

Base class implementing the shared, non-behavioral parts of IMonitorService adapters.

Type Parameters

TType

TType extends Site["monitors"][number]["type"]

Implements

Constructors

Constructor

protected new MonitorServiceAdapterBase<TType>(args: { axiosInstance: AxiosInstance; config: MonitorServiceConfig; type: TType; }): MonitorServiceAdapterBase<TType>

Defined in: electron/services/monitoring/shared/monitorServiceAdapterBase.ts:37

Parameters

args
axiosInstance

AxiosInstance

config

MonitorServiceConfig

type

TType

Returns

MonitorServiceAdapterBase<TType>

Properties

axiosInstance

protected axiosInstance: AxiosInstance

Defined in: electron/services/monitoring/shared/monitorServiceAdapterBase.ts:31


config

protected config: MonitorServiceConfig

Defined in: electron/services/monitoring/shared/monitorServiceAdapterBase.ts:33


type

private readonly type: TType

Defined in: electron/services/monitoring/shared/monitorServiceAdapterBase.ts:35

Methods

check()

abstract check(monitor: Monitor, signal?: AbortSignal): Promise<MonitorCheckResult>

Defined in: electron/services/monitoring/shared/monitorServiceAdapterBase.ts:47

Perform a health check on a monitor.

Parameters

monitor

Monitor

The monitor configuration to check

signal?

AbortSignal

Optional AbortSignal for operation cancellation

Returns

Promise<MonitorCheckResult>

Promise resolving to the check result

Remarks

Implementations should handle timeouts, retries, and error conditions gracefully. Failed checks should return a result with status: "down" rather than throwing, unless the monitor configuration itself is invalid. Supports optional AbortSignal for operation cancellation.

Throws

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error When monitor configuration is invalid or check fails catastrophically

Implementation of

IMonitorService.check


getType()

getType(): "cdn-edge-consistency" | "dns" | "http" | "http-header" | "http-json" | "http-keyword" | "http-latency" | "http-status" | "ping" | "port" | "replication" | "server-heartbeat" | "ssl" | "websocket-keepalive"

Defined in: electron/services/monitoring/shared/monitorServiceAdapterBase.ts:52

Get the type of monitor this service handles.

Returns

"cdn-edge-consistency" | "dns" | "http" | "http-header" | "http-json" | "http-keyword" | "http-latency" | "http-status" | "ping" | "port" | "replication" | "server-heartbeat" | "ssl" | "websocket-keepalive"

The monitor type this service is responsible for

Remarks

Used by the monitor factory to route checks to the appropriate service. Must match one of the values in the monitor's type field.

Implementation of

IMonitorService.getType


updateConfig()

abstract updateConfig(config: Partial<MonitorServiceConfig>): void

Defined in: electron/services/monitoring/shared/monitorServiceAdapterBase.ts:56

Update the configuration for this monitor service.

Parameters

config

Partial<MonitorServiceConfig>

Partial configuration to update

Returns

void

Remarks

Allows runtime configuration updates without recreating the service instance. Only the provided configuration properties will be updated.

Implementation of

IMonitorService.updateConfig