Reference Source
public class | source

MetricsServer

Extends:

devapt-core-common/dist/js/base/distributed_instance~DistributedInstanceServer → MetricsServer

Metrics server class.

Example:

	API:
		->build_server()

		->receive_metrics(arg_msg)
		->process_metric(arg_metric_type, arg_metrics)

		->get_metrics_state_values(arg_type)

		->get_http_metrics_state_values()

		->get_host_metrics_state_values()
		->get_host_metrics_state_values_items()
		->get_host_metrics_state_values_for(arg_hostname)

		->get_bus_metrics_state_values()
		->get_bus_metrics_state_values_items()
		->get_bus_metrics_state_values_for(arg_busname)

		->get_nodejs_metrics_state_values()
		->get_nodejs_metrics_state_values_items()
		->get_nodejs_metrics_state_values_for(arg_runtime_uid)

Constructor Summary

Public Constructor
public

constructor(arg_name: string, arg_settings: Immutable.Map, arg_context: string): nothing

Create MetricsServer instance to process metrics records.

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

build_server(): nothing

Build server.

public

Get bus metrics state values.

public

Get bus metrics state values for a bus name.

public

Get bus metrics state values.

public

Get host metrics state values.

public

Get host metrics state values for an hostname.

public

Get host metrics state values.

public

Get http metrics state values.

public

Get metrics state values.

public

Get metrics state values keys.

public

Get nodejs metrics state values.

public

Get nodejs metrics state values for a nodejs instance.

public

Get host metrics state values.

public

process_metric(arg_metric_type: *, arg_metrics: *): nothing

Process metrics records.

public

receive_metrics(arg_msg: DistributedMetrics): nothing

Process received metrics message (to override in sub classes).

Inherited Summary

From class Server
public
public
public
public

server: *

public
public
public
public
public
public
public
public
public

build_server(): nothing

Build private server instance.

public

disable(): nothing

Disable server (stop it).

public

enable(): nothing

Enable server (start it).

public

get_security_settings(): Immutable.Map

Get security settings from server or runtime.

public

Get security settings object into the server.

public

get_topology_info(arg_deep: boolean, arg_visited: object): object

Get topology item informations.

public

load(): nothing

Load server settings.

public

use_service_on_loading(arg_application: Application, arg_service: Service, arg_app_svc_cfg: object): nothing

Add a service to use before or after security check.

Public Constructors

public constructor(arg_name: string, arg_settings: Immutable.Map, arg_context: string): nothing source

Create MetricsServer instance to process metrics records.

Override:

Server#constructor

Params:

NameTypeAttributeDescription
arg_name string

server instance name

arg_settings Immutable.Map

server instance settings

arg_context string

logging context

Return:

nothing

Public Members

public is_metric_server: boolean source

public metrics_collectors: {} source

Public Methods

public build_server(): nothing source

Build server.

Override:

Server#build_server

Return:

nothing

public get_bus_metrics_state_values(): Object source

Get bus metrics state values.

Return:

Object

bus state values object.

public get_bus_metrics_state_values_for(arg_bus_name: string): Object source

Get bus metrics state values for a bus name.

Params:

NameTypeAttributeDescription
arg_bus_name string

bus name.

Return:

Object

bus state values object.

public get_bus_metrics_state_values_items(): Object source

Get bus metrics state values.

Return:

Object

bus state values object.

public get_host_metrics_state_values(): Object source

Get host metrics state values.

Return:

Object

host state values object.

public get_host_metrics_state_values_for(arg_hostname: string): Object source

Get host metrics state values for an hostname.

Params:

NameTypeAttributeDescription
arg_hostname string

hostname.

Return:

Object

host state values object.

public get_host_metrics_state_values_items(): Object source

Get host metrics state values.

Return:

Object

host state values object.

public get_http_metrics_state_values(): Object source

Get http metrics state values.

Return:

Object

http state values object.

public get_metrics_state_values(arg_type: string, arg_key: string): object source

Get metrics state values.

Params:

NameTypeAttributeDescription
arg_type string

metrics type.

arg_key string

metrics key.

Return:

object

metrics collector state values object.

public get_metrics_state_values_items(arg_type: string): array source

Get metrics state values keys.

Params:

NameTypeAttributeDescription
arg_type string

metrics type.

Return:

array

state values keys.

public get_nodejs_metrics_state_values(): Object source

Get nodejs metrics state values.

Return:

Object

nodejs state values object.

public get_nodejs_metrics_state_values_for(arg_runtime_uid: string): Object source

Get nodejs metrics state values for a nodejs instance.

Params:

NameTypeAttributeDescription
arg_runtime_uid string

nodejs runtime uid.

Return:

Object

nodejs state values object.

public get_nodejs_metrics_state_values_items(): Object source

Get host metrics state values.

Return:

Object

host state values object.

public process_metric(arg_metric_type: *, arg_metrics: *): nothing source

Process metrics records.

{string} arg_metric_type - metrics type (host, http...) {array} arg_metrics - Array of metrics plain objects

Params:

NameTypeAttributeDescription
arg_metric_type *
arg_metrics *

Return:

nothing

public receive_metrics(arg_msg: DistributedMetrics): nothing source

Process received metrics message (to override in sub classes).

Params:

NameTypeAttributeDescription
arg_msg DistributedMetrics

metrics message instance.

Return:

nothing