Monitor

Monitor status of multiple resources at a fixed interval. All probes associated with a given monitoring instance are executed at the same interval.

Constructor

new Monitor(opts)

Create a monitof for a time interval.

Parameters:
NameTypeDescription
optsMonitorOptions
Properties
NameTypeDescription
intervalmilliseconds

monitoring period (1000)

Classes

Monitor

Methods

probeUrl(url, jsonFilter) → {Probe}

Add a probe to monitor the given url

Parameters:
NameTypeDescription
urlurl

resource to monitor

jsonFilterJsonFilter

expect JSON response (see properties for UrlProbe.normalizeState()). If omitted, just record the status code. If null, record entire state.

Returns:

probe

  • probe.url the URL being probed
  • probe.jsonFilter see jsonFilter parameter
  • probe.stateLog StateLog instance
Type: 
Probe

start()

Start monitor. Currently this can only be called once

stop()

Stop monitoring and free up all resources.