Skip to main content

HealthCheck

Datalayer Core


Datalayer Core / HealthCheck

Class: HealthCheck

Defined in: src/models/HealthCheck.ts:12

Represents a health check response from a Datalayer service. Provides standardized health status information across all services.

Constructors

Constructor

new HealthCheck(data, sdk): HealthCheck

Defined in: src/models/HealthCheck.ts:25

Create a HealthCheck instance.

Parameters

data

any

The health check data

sdk

any

Reference to the SDK instance (unused but kept for consistency)

Returns

HealthCheck

Properties

errors

errors: string[]

Defined in: src/models/HealthCheck.ts:17


healthy

healthy: boolean

Defined in: src/models/HealthCheck.ts:14


responseTime

responseTime: number

Defined in: src/models/HealthCheck.ts:16


status

status: string

Defined in: src/models/HealthCheck.ts:15


timestamp

timestamp: Date

Defined in: src/models/HealthCheck.ts:18

Methods

getErrors()

getErrors(): string[]

Defined in: src/models/HealthCheck.ts:62

Get any errors reported during the health check.

Returns

string[]

Array of error messages


getResponseTime()

getResponseTime(): number

Defined in: src/models/HealthCheck.ts:54

Get the response time in milliseconds.

Returns

number

The response time


getStatus()

getStatus(): string

Defined in: src/models/HealthCheck.ts:46

Get the service status.

Returns

string

The status string


getSummary()

getSummary(): string

Defined in: src/models/HealthCheck.ts:86

Get a human-readable summary of the health check.

Returns

string

Summary string


getTimestamp()

getTimestamp(): Date

Defined in: src/models/HealthCheck.ts:70

Get the timestamp of the health check.

Returns

Date

The timestamp


hasErrors()

hasErrors(): boolean

Defined in: src/models/HealthCheck.ts:78

Check if there are any errors.

Returns

boolean

True if there are errors


isHealthy()

isHealthy(): boolean

Defined in: src/models/HealthCheck.ts:38

Check if the service is healthy.

Returns

boolean

True if the service is healthy


toJSON()

toJSON(): Promise<HealthCheckJSON>

Defined in: src/models/HealthCheck.ts:99

Convert to a plain object.

Returns

Promise<HealthCheckJSON>

Plain object representation


toString()

toString(): string

Defined in: src/models/HealthCheck.ts:115

Get a string representation.

Returns

string

String representation