Skip to main content
Access via:io.metrics

Properties (9)

Property Type Default Required Description
description⚓︎ string x

Returns the description of the system.

id⚓︎ string x

ID of the system in the format RootName/ParentName/.../CurrentSystemName.

metrics⚓︎ Metric[] x

Returns an array of metrics.

name⚓︎ string x

Returns the name of the system.

parent⚓︎ System x x

Returns the parent system of the current system.

path⚓︎ string[] x

An array of parent system names, starting with the root system name.

repo⚓︎ Repository x

Returns the repository of the system.

root⚓︎ System x

The root system in the repository.

subSystems⚓︎ System[] x

Returns an array of the subsystems.

9 Methods

featureMetric()⚓︎

(feature: string, action: string, value: string) => void

The feature metric is under the subsystem with name "reporting".

Parameters (3)

Name Type Required Description
feature⚓︎ string

The main feature you want to gather information about.

action⚓︎ string

The specific action you want to track.

value⚓︎ string

The payload of the metric - the value(s) you are interested in.

Example

io.metrics.featureMetric("export", "exportToExcel", "file.xls");

getAggregateState()⚓︎

Returns the aggregate system state represented as an array of the states of all subsystems.

getState()⚓︎

() => State

Returns the system state.

numberMetric()⚓︎

(definition: string | MetricDefinition, value: number) => NumberMetric

Creates a new Number Metric.

Parameters (2)

Name Type Required Description
definition⚓︎ string | MetricDefinition

Metric definition.

value⚓︎ number

Metric value.

objectMetric()⚓︎

(definition: string | MetricDefinition, value: any) => ObjectMetric

Creates a new Object Metric.

Parameters (2)

Name Type Required Description
definition⚓︎ string | MetricDefinition

Metric definition.

value⚓︎ any

Metric value.

setState()⚓︎

(state: number, description?: string) => void

Updates the state of the system.

Parameters (2)

Name Type Required Description
state⚓︎ number

Value for the state.

description⚓︎ string x

Description for the state.

stringMetric()⚓︎

(definition: string | MetricDefinition, value: string) => StringMetric

Creates a new String Metric.

Parameters (2)

Name Type Required Description
definition⚓︎ string | MetricDefinition

Metric definition.

value⚓︎ string

Metric value.

subSystem()⚓︎

(name: string, description?: string) => System

Creates a new subsystem.

Parameters (2)

Name Type Required Description
name⚓︎ string

Name for the subsystem.

description⚓︎ string x

Description for the subsystem.

timestampMetric()⚓︎

(definition: string | MetricDefinition, value: any) => TimestampMetric

Creates a new Timestamp Metric.

Parameters (2)

Name Type Required Description
definition⚓︎ string | MetricDefinition

Metric definition.

value⚓︎ any

Metric value.