Skip to main content
Access via:io.metrics.parent

A metrics system. A system can be created in another system as a subsystem.

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.

8 Methods

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.