Metrics

5.1.0

To 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.

object

(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

yes

The main feature you want to gather information about.

action

string

yes

The specific action you want to track.

value

string

yes

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

Returns

void

Example

glue.metrics.featureMetric("export", "exportToExcel", "file.xls");
methodsubSystem
(name: string, description: string) => System

Description

Creates a new subsystem.

Parameters

Name
Type
Required
Description

name

string

yes

Name for the subsystem.

description

string

no

Description for the subsystem.

Returns

System

methodgetState
() => State

Description

Returns the system state.

Returns

State

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

Description

Updates the state of the system.

Parameters

Name
Type
Required
Description

state

number

yes

Value for the state.

description

string

no

Description for the state.

Returns

void

Description

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

Returns

SystemStateInfo[]

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

Description

Creates a new Number Metric.

Parameters

Name
Type
Required
Description

definition

string | MetricDefinition

yes

Metric definition.

value

number

yes

Metric value.

Returns

NumberMetric

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

Description

Creates a new Object Metric.

Parameters

Name
Type
Required
Description

definition

string | MetricDefinition

yes

Metric definition.

value

any

yes

Metric value.

Returns

ObjectMetric

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

Description

Creates a new String Metric.

Parameters

Name
Type
Required
Description

definition

string | MetricDefinition

yes

Metric definition.

value

string

yes

Metric value.

Returns

StringMetric

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

Description

Creates a new Timestamp Metric.

Parameters

Name
Type
Required
Description

definition

string | MetricDefinition

yes

Metric definition.

value

any

yes

Metric value.

Returns

TimestampMetric

Properties

string

Returns the name of the system.

string

Returns the description of the system.

Returns the repository of the system.

Returns the parent system of the current system.

string[]

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

string

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

The root system in the repository.

Returns an array of the subsystems.

Returns an array of metrics.

object

Description

Aggregate system state.

Properties

string

Name of the metrics system.

string[]

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

number

Code number for the state.

string

Description of the state.

object

Description

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

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

Description

Creates a new subsystem.

Parameters

Name
Type
Required
Description

name

string

yes

Name for the subsystem.

description

string

no

Description for the subsystem.

Returns

System

methodgetState
() => State

Description

Returns the system state.

Returns

State

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

Description

Updates the state of the system.

Parameters

Name
Type
Required
Description

state

number

yes

Value for the state.

description

string

no

Description for the state.

Returns

void

Description

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

Returns

SystemStateInfo[]

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

Description

Creates a new Number Metric.

Parameters

Name
Type
Required
Description

definition

string | MetricDefinition

yes

Metric definition.

value

number

yes

Metric value.

Returns

NumberMetric

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

Description

Creates a new Object Metric.

Parameters

Name
Type
Required
Description

definition

string | MetricDefinition

yes

Metric definition.

value

any

yes

Metric value.

Returns

ObjectMetric

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

Description

Creates a new String Metric.

Parameters

Name
Type
Required
Description

definition

string | MetricDefinition

yes

Metric definition.

value

string

yes

Metric value.

Returns

StringMetric

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

Description

Creates a new Timestamp Metric.

Parameters

Name
Type
Required
Description

definition

string | MetricDefinition

yes

Metric definition.

value

any

yes

Metric value.

Returns

TimestampMetric

Properties

string

Returns the name of the system.

string

Returns the description of the system.

Returns the repository of the system.

Returns the parent system of the current system.

string[]

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

string

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

The root system in the repository.

Returns an array of the subsystems.

Returns an array of metrics.

object

Description

State of the metric system.

Properties

number

Code number for the state.

string

Description of the state.

object

Description

Metric definition.

Properties

string

Name of the metric.

string

Description for the metric.

object

Description

Basic metric.

methodupdate
(value: any) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

any

yes

Returns

void

Properties

string

Returns the name of the metric.

string

Returns the description of the metric.

Returns the system of the metric.

Returns the repository of the metric.

string

Returns the ID of the metric.

number

Returns the type of the metric.

string[]

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

any

Returns the value of the metric.

object

Description

Metrics systems repository.

Properties

Returns the root metrics system.

object

Description

Number metric.

methodupdate
(value: number) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

number

yes

Value with which to update the metric.

Returns

void

(num: number) => void

Description

Increments the value of the metric by the specified number.

Parameters

Name
Type
Required
Description

num

number

yes

Number by which to increment the metric.

Returns

void

methodincrement
() => void

Description

Increments the value of the metric by 1.

Returns

void

methoddecrement
() => void

Description

Decrements the value of the metric by 1

Returns

void

(num: number) => void

Description

Decrements the value of the metric by the specified number.

Parameters

Name
Type
Required
Description

num

number

yes

Number by which to decrement the metric.

Returns

void

methodupdate
(value: any) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

any

yes

Returns

void

Properties

number

Returns the value of the metric.

string

Returns the name of the metric.

string

Returns the description of the metric.

Returns the system of the metric.

Returns the repository of the metric.

string

Returns the ID of the metric.

number

Returns the type of the metric.

string[]

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

any

Returns the value of the metric.

object

Description

Object metric.

methodupdate
(value: any) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

any

yes

Value with which to update the metric.

Returns

void

methodupdate
(value: any) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

any

yes

Returns

void

Properties

any

Returns the value of the metric.

string

Returns the name of the metric.

string

Returns the description of the metric.

Returns the system of the metric.

Returns the repository of the metric.

string

Returns the ID of the metric.

number

Returns the type of the metric.

string[]

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

any

Returns the value of the metric.

object

Description

String metric.

methodupdate
(value: string) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

string

yes

Value with which to update the metric.

Returns

void

methodupdate
(value: any) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

any

yes

Returns

void

Properties

string

Returns the value of the metric.

string

Returns the name of the metric.

string

Returns the description of the metric.

Returns the system of the metric.

Returns the repository of the metric.

string

Returns the ID of the metric.

number

Returns the type of the metric.

string[]

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

any

Returns the value of the metric.

object

Description

Timestamp metric.

methodupdate
(value: Date) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

Date

yes

Value with which to update the metric.

Returns

void

methodnow
() => void

Description

Updates the metric with the current date and time.

Returns

void

methodupdate
(value: any) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

any

yes

Returns

void

Properties

any

Returns the value of the metric.

string

Returns the name of the metric.

string

Returns the description of the metric.

Returns the system of the metric.

Returns the repository of the metric.

string

Returns the ID of the metric.

number

Returns the type of the metric.

string[]

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

any

Returns the value of the metric.

object

Description

Count metric.

methodupdate
(value: number) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

number

yes

Value with which to update the metric.

Returns

void

(num: number) => void

Description

Increments the value of the metric by the specified number.

Parameters

Name
Type
Required
Description

num

number

yes

Number by which to increment the metric.

Returns

void

methodincrement
() => void

Description

Increments the value of the metric by 1.

Returns

void

methoddecrement
() => void

Description

Decrements the value of the metric by 1.

Returns

void

(num: number) => void

Description

Decrements the value of the metric by the specified number.

Parameters

Name
Type
Required
Description

num

number

yes

Number by which to decrement the metric.

Returns

void

methodupdate
(value: any) => void

Description

Updates the value of the metric.

Parameters

Name
Type
Required
Description

value

any

yes

Returns

void

Properties

number

Returns the value of the metric.

string

Returns the name of the metric.

string

Returns the description of the metric.

Returns the system of the metric.

Returns the repository of the metric.

string

Returns the ID of the metric.

number

Returns the type of the metric.

string[]

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

any

Returns the value of the metric.