Home Manual Reference Source Test API Healthcheck
public class | source

HealthcheckHelper

You can directly use an instance of this class. healthcheckHelper

Class to wrap the methods that are used for server healthcheck

Constructor Summary

Public Constructor
public

Creates the Healthcheck helper by loading the configuration file and parsing the database and external service configurations

Member Summary

Public Members
public

dbMap: {}

public

Method Summary

Public Methods
public

async getStatus(level: String): any

Returns the status

public

async isRunning(serviceName: string): Boolean

Returns whether the service passed is running

Public Constructors

public constructor() source

Creates the Healthcheck helper by loading the configuration file and parsing the database and external service configurations

Public Members

public dbMap: {} source

public serviceMap: {} source

Public Methods

public async getStatus(level: String): any source

Returns the status

Params:

NameTypeAttributeDescription
level String

of healthcheck status to view L1: this server + version L2: databases and other essential services we manage for the endpoints to work L3: external services we don't have control over and hopefully we catch errors for to explain to user

Return:

any

status of services in that level (or full status of server if no level provided)

public async isRunning(serviceName: string): Boolean source

Returns whether the service passed is running

Params:

NameTypeAttributeDescription
serviceName string

name of the service/database to check is running

Return:

Boolean

whether or not the service returns it is healthy