Reference Source
public class | source

MetricsReducer

Reducer class for HTTP metrics collect.

Constructor Summary

Public Constructor
public

constructor(arg_metrics_name: string): nothing

Reducer for metrics class.

Member Summary

Public Members
public

Class test flag.

public

Metrics series name.

Method Summary

Public Methods
public

Create a new state instance.

public

incr(arg_state_values: object, arg_state_key: string, arg_metrics_values_key: string): MetricsState

Increment a state value.

public

reduce(arg_state: MetricsState, arg_metrics_values: object | array): object

Reduce metrics records to a state.

public

reduce_one_record(arg_state_values: object, arg_metrics_values: object, arg_state: MetricsState): object

Reduce metrics records into a state.

Public Constructors

public constructor(arg_metrics_name: string): nothing source

Reducer for metrics class.

Params:

NameTypeAttributeDescription
arg_metrics_name string

metrics series name ('http', 'host'...)

Return:

nothing

Public Members

public is_metrics_reducer: boolean source

Class test flag.

public name: string source

Metrics series name.

Public Methods

public create_state(): MetricsState source

Create a new state instance.

Return:

MetricsState

a new metrics state instance.

public incr(arg_state_values: object, arg_state_key: string, arg_metrics_values_key: string): MetricsState source

Increment a state value.

Params:

NameTypeAttributeDescription
arg_state_values object

values map object.

arg_state_key string

metrics state values.

arg_metrics_values_key string

metrics values key.

Return:

MetricsState

a new metrics state instance.

public reduce(arg_state: MetricsState, arg_metrics_values: object | array): object source

Reduce metrics records to a state.

Params:

NameTypeAttributeDescription
arg_state MetricsState

metrics state.

arg_metrics_values object | array

metrics records values.

Return:

object

metrics state values.

public reduce_one_record(arg_state_values: object, arg_metrics_values: object, arg_state: MetricsState): object source

Reduce metrics records into a state.

Params:

NameTypeAttributeDescription
arg_state_values object

metrics state values.

arg_metrics_values object

metrics records values.

arg_state MetricsState

metrics state.

Return:

object

metrics state values.