Constructor
new UrlProbe(opts)
Build a UrlProbe
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | UrlProbeOptions | Properties
|
- Source
Classes
Methods
(async) probe(date)
Probe the URL once and log the result for the given timestamp in the StateLog of the probe.
Parameters:
Name | Type | Description |
---|---|---|
date | Date | logging date (vs. result date) |
- Source
(async, static) fetch(url, opts)
fetch with timeout
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
url | URL | as for fetch() | ||||||
opts | fetchOptions | as for fetch() Properties
|
- Source
(static) normalizeState(state, properties) → {serializable}
Normalize given state for storage. Normalization can remove unwanted properties. Normalization can also trim property values.
Parameters:
Name | Type | Description |
---|---|---|
state | serializable | raw state to be normalized |
properties | StateLogProperties | normalization parameters. |
- Source
Returns:
normalized object as defined by:
- If properties.xyz is true, that property is included in normalized state.
- If properties.xyz is a string, the string is converted to a regular expression and the state value of that property is stripped of anything that does not match that regular expression.
- If properties.xyz is anything else, an Error is thrown.
- If properties is null, the entire state is left as is.
- Type:
- serializable