Metrics
1.6.5To improve the efficiency of your business processes, you often find the need to collect extensive data about the daily workflows and routines within your company. You want to see the specific actions your employees take and the choices they make when achieving outstanding results or when performing poorly, so that you can optimize your processes or tools. Metrics data is also useful for technical purposes like monitoring how well your hardware infrastructure handles the workload or to track the performance of your applications.
See also the Metrics documentation for more details.
APIobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the system. |
||
id | string | ID of the system in the format |
||
identity | Identity | Returns the identity of the system. |
||
metrics | Metric[] | Returns an array of metrics. |
||
name | string | Returns the name of the system. |
||
parent | System | Returns the parent system of the current system. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the system. |
||
root | System | The root system in the repository. |
||
subSystems | System[] | Returns an array of the subsystems. |
Methods
addressMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => AddressMetric
Description
Creates a new Address Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any |
countMetricmethod
Signature
(definition: string | MetricDefinition, value: number) => CountMetric
Description
Creates a new Count Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | number | Metric value. |
featureMetricmethod
Signature
(feature: string, action: string, value: string) => void
Description
The feature metric is under the subsystem with name "reporting".
Parameters
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
glue.metrics.featureMetric("export", "exportToExcel", "file.xls");
getAggregateStatemethod
Signature
() => SystemStateInfo[]
Description
Returns the aggregate system state represented as an array of the states of all subsystems.
getStatemethod
numberMetricmethod
Signature
(definition: string | MetricDefinition, value: number) => NumberMetric
Description
Creates a new Number Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | number | Metric value. |
objectMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => ObjectMetric
Description
Creates a new Object Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any | Metric value. |
rateMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => RateMetric
Description
Creates a new Rate Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any | Metric value. |
setStatemethod
Signature
(state: number, description?: string) => void
Description
Updates the state of the system.
Parameters
Name | Type | Required | Description |
---|---|---|---|
state | number | Value for the state. |
|
description | string | Description for the state. |
statisticsMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => StatisticsMetric
Description
Creates a new Statistics Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any | Metric value. |
stringMetricmethod
Signature
(definition: string | MetricDefinition, value: string) => StringMetric
Description
Creates a new String Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | string | Metric value. |
subSystemmethod
Signature
(name: string, description?: string) => System
Description
Creates a new subsystem.
Parameters
Name | Type | Required | Description |
---|---|---|---|
name | string | Name for the subsystem. |
|
description | string | Description for the subsystem. |
timespanMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => TimespanMetric
Description
Creates a new Timespan Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any | Metric value. |
timestampMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => TimestampMetric
Description
Creates a new Timestamp Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any | Metric value. |
AddressMetricobject
Description
Address metric.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the metric. |
||
id | string | Returns the ID of the metric. |
||
name | string | Returns the name of the metric. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the metric. |
||
system | System | Returns the system of the metric. |
||
type | number | Returns the type of the metric. |
||
value | any | Returns the value of the metric. |
Methods
getValueTypemethod
Signature
() => void
Description
Returns the value type of the metric.
updatemethod
Signature
(value: any) => void
Description
Updates the value of the metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | any |
CountMetricobject
Description
Count metric.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the metric. |
||
id | string | Returns the ID of the metric. |
||
name | string | Returns the name of the metric. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the metric. |
||
system | System | Returns the system of the metric. |
||
type | number | Returns the type of the metric. |
||
value | number | Returns the value of the metric. |
Methods
decrementmethod
Signature
() => void
Description
Decrements the value of the metric by 1.
decrementBymethod
Signature
(num: number) => void
Description
Decrements the value of the metric by the specified number.
Parameters
Name | Type | Required | Description |
---|---|---|---|
num | number | Number by which to decrement the metric. |
getValueTypemethod
Signature
() => void
Description
Returns the value type of the metric.
incrementmethod
Signature
() => void
Description
Increments the value of the metric by 1.
incrementBymethod
Signature
(num: number) => void
Description
Increments the value of the metric by the specified number.
Parameters
Name | Type | Required | Description |
---|---|---|---|
num | number | Number by which to increment the metric. |
updatemethod
Signature
(value: number) => void
Description
Updates the value of the metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | number | Value with which to update the metric. |
Identityobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
instance | string | |||
service | string | |||
system | string |
Metricobject
Description
Basic metric.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the metric. |
||
id | string | Returns the ID of the metric. |
||
name | string | Returns the name of the metric. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the metric. |
||
system | System | Returns the system of the metric. |
||
type | number | Returns the type of the metric. |
||
value | any | Returns the value of the metric. |
Methods
getValueTypemethod
Signature
() => void
Description
Returns the value type of the metric.
updatemethod
Signature
(value: any) => void
Description
Updates the value of the metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | any |
MetricDefinitionobject
Description
Metric definition.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Description for the metric. |
||
name | string | Name of the metric. |
NumberMetricobject
Description
Number metric.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the metric. |
||
id | string | Returns the ID of the metric. |
||
name | string | Returns the name of the metric. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the metric. |
||
system | System | Returns the system of the metric. |
||
type | number | Returns the type of the metric. |
||
value | number | Returns the value of the metric. |
Methods
decrementmethod
Signature
() => void
Description
Decrements the value of the metric by 1
decrementBymethod
Signature
(num: number) => void
Description
Decrements the value of the metric by the specified number.
Parameters
Name | Type | Required | Description |
---|---|---|---|
num | number | Number by which to decrement the metric. |
getValueTypemethod
Signature
() => void
Description
Returns the value type of the metric.
incrementmethod
Signature
() => void
Description
Increments the value of the metric by 1.
incrementBymethod
Signature
(num: number) => void
Description
Increments the value of the metric by the specified number.
Parameters
Name | Type | Required | Description |
---|---|---|---|
num | number | Number by which to increment the metric. |
updatemethod
Signature
(value: number) => void
Description
Updates the value of the metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | number | Value with which to update the metric. |
ObjectMetricobject
Description
Object metric.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the metric. |
||
id | string | Returns the ID of the metric. |
||
name | string | Returns the name of the metric. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the metric. |
||
system | System | Returns the system of the metric. |
||
type | number | Returns the type of the metric. |
||
value | any | Returns the value of the metric. |
Methods
getValueTypemethod
Signature
() => void
Description
Returns the value type of the metric.
updatemethod
Signature
(value: any) => void
Description
Updates the value of the metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | any | Value with which to update the metric. |
RateMetricobject
Description
Rate metric.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the metric. |
||
id | string | Returns the ID of the metric. |
||
name | string | Returns the name of the metric. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the metric. |
||
system | System | Returns the system of the metric. |
||
type | number | Returns the type of the metric. |
||
value | number | Returns the value of the metric. |
Methods
getValueTypemethod
Signature
() => void
Description
Returns the value type of the metric.
updatemethod
Signature
(value: number) => void
Description
Updates the value of the metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | number | Value with which to update the metric. |
Repositoryobject
Description
Metrics systems repository.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
identity | Identity | Returns the identity of the root system. |
||
instance | string | Returns the instance ID of the root system. |
||
root | System | Returns the root metrics system. |
Stateobject
Description
State of the metric system.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Description of the state. |
||
state | number | Code number for the state. |
StatisticsMetricobject
Description
Statistics metric.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the metric. |
||
id | string | Returns the ID of the metric. |
||
name | string | Returns the name of the metric. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the metric. |
||
system | System | Returns the system of the metric. |
||
type | number | Returns the type of the metric. |
||
value | any | Returns the value of the metric. |
Methods
getValueTypemethod
Signature
() => void
Description
Returns the value type of the metric.
updatemethod
Signature
(value: number) => void
Description
Updates the value of the metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | number | Value with which to update the metric. |
StringMetricobject
Description
String metric.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the metric. |
||
id | string | Returns the ID of the metric. |
||
name | string | Returns the name of the metric. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the metric. |
||
system | System | Returns the system of the metric. |
||
type | number | Returns the type of the metric. |
||
value | string | Returns the value of the metric. |
Methods
getValueTypemethod
Signature
() => void
Description
Returns the value type of the metric.
updatemethod
Signature
(value: string) => void
Description
Updates the value of the metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | string | Value with which to update the metric. |
Systemobject
Description
A metrics system. A system can be created in another system as a subsystem.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the system. |
||
id | string | ID of the system in the format |
||
identity | Identity | Returns the identity of the system. |
||
metrics | Metric[] | Returns an array of metrics. |
||
name | string | Returns the name of the system. |
||
parent | System | Returns the parent system of the current system. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the system. |
||
root | System | The root system in the repository. |
||
subSystems | System[] | Returns an array of the subsystems. |
Methods
addressMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => AddressMetric
Description
Creates a new Address Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any |
countMetricmethod
Signature
(definition: string | MetricDefinition, value: number) => CountMetric
Description
Creates a new Count Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | number | Metric value. |
getAggregateStatemethod
Signature
() => SystemStateInfo[]
Description
Returns the aggregate system state represented as an array of the states of all subsystems.
getStatemethod
numberMetricmethod
Signature
(definition: string | MetricDefinition, value: number) => NumberMetric
Description
Creates a new Number Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | number | Metric value. |
objectMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => ObjectMetric
Description
Creates a new Object Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any | Metric value. |
rateMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => RateMetric
Description
Creates a new Rate Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any | Metric value. |
setStatemethod
Signature
(state: number, description?: string) => void
Description
Updates the state of the system.
Parameters
Name | Type | Required | Description |
---|---|---|---|
state | number | Value for the state. |
|
description | string | Description for the state. |
statisticsMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => StatisticsMetric
Description
Creates a new Statistics Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any | Metric value. |
stringMetricmethod
Signature
(definition: string | MetricDefinition, value: string) => StringMetric
Description
Creates a new String Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | string | Metric value. |
subSystemmethod
Signature
(name: string, description?: string) => System
Description
Creates a new subsystem.
Parameters
Name | Type | Required | Description |
---|---|---|---|
name | string | Name for the subsystem. |
|
description | string | Description for the subsystem. |
timespanMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => TimespanMetric
Description
Creates a new Timespan Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any | Metric value. |
timestampMetricmethod
Signature
(definition: string | MetricDefinition, value: any) => TimestampMetric
Description
Creates a new Timestamp Metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definition | string | MetricDefinition | Metric definition. |
|
value | any | Metric value. |
SystemStateInfoobject
Description
Aggregate system state.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Description of the state. |
||
name | string | Name of the metrics system. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
state | number | Code number for the state. |
TimespanMetricobject
Description
Timespan metric.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the metric. |
||
id | string | Returns the ID of the metric. |
||
name | string | Returns the name of the metric. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the metric. |
||
system | System | Returns the system of the metric. |
||
type | number | Returns the type of the metric. |
||
value | any | Returns the value of the metric. |
Methods
getValueTypemethod
Signature
() => void
Description
Returns the value type of the metric.
startmethod
Signature
() => void
Description
Starts measuring the timespan.
stopmethod
Signature
() => void
Description
Stops measuring the timespan.
updatemethod
Signature
(value: string) => void
Description
Updates the value of the metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | string | Value with which to update the metric. |
TimestampMetricobject
Description
Timestamp metric.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
description | string | Returns the description of the metric. |
||
id | string | Returns the ID of the metric. |
||
name | string | Returns the name of the metric. |
||
path | string[] | An array of parent system names, starting with the root system name. |
||
repo | Repository | Returns the repository of the metric. |
||
system | System | Returns the system of the metric. |
||
type | number | Returns the type of the metric. |
||
value | any | Returns the value of the metric. |
Methods
getValueTypemethod
Signature
() => void
Description
Returns the value type of the metric.
nowmethod
Signature
() => void
Description
Updates the metric with the current date and time.
updatemethod
Signature
(value: string) => void
Description
Updates the value of the metric.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | string | Value with which to update the metric. |