Skip to main content

Abstract Class: ConfigurableMonitorServiceBase<TType>

Defined in: electron/services/monitoring/shared/configurableMonitorServiceBase.ts:18

Shared base for monitor services that only need normalized config storage.

Hierarchy​

View Summary

Extended by​

Type Parameters​

TType​

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

Implements​

Constructors​

Constructor​

protected new ConfigurableMonitorServiceBase<TType>(args: {
config?: Partial<MonitorServiceConfig>;
defaultTimeoutMs: number;
type: TType;
}): ConfigurableMonitorServiceBase<TType>;

Defined in: electron/services/monitoring/shared/configurableMonitorServiceBase.ts:25

Parameters​

args​
config?​

Partial<MonitorServiceConfig>

defaultTimeoutMs​

number

type​

TType

Returns​

ConfigurableMonitorServiceBase<TType>

Properties​

config​

protected config: MonitorServiceConfig;

Defined in: electron/services/monitoring/shared/configurableMonitorServiceBase.ts:21


type​

private readonly type: TType;

Defined in: electron/services/monitoring/shared/configurableMonitorServiceBase.ts:23

Methods​

check()​

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

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

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​

Error when monitor configuration is invalid or check fails catastrophically

Implementation of​

IMonitorService.check


getConfig()​

getConfig(): MonitorServiceConfig;

Defined in: electron/services/monitoring/shared/configurableMonitorServiceBase.ts:42

Returns​

MonitorServiceConfig


getType()​

getType(): TType;

Defined in: electron/services/monitoring/shared/configurableMonitorServiceBase.ts:46

Get the type of monitor this service handles.

Returns​

TType

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()​

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

Defined in: electron/services/monitoring/shared/configurableMonitorServiceBase.ts:50

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


validateConfigUpdate()​

protected validateConfigUpdate(_config: Partial<MonitorServiceConfig>): void;

Defined in: electron/services/monitoring/shared/configurableMonitorServiceBase.ts:58

Parameters​

_config​

Partial<MonitorServiceConfig>

Returns​

void