Reference Source
public class | source

MetricsSvcProvider

Extends:

devapt-core-common/dist/js/services/service_provider~ServiceProvider → MetricsSvcProvider

Metrics service provider class.

Constructor Summary

Public Constructor
public

constructor(arg_provider_name: string, arg_service_instance: Service, arg_context: string): nothing

Create a metrics service provider.

Member Summary

Public Members
public

Class test flag.

Private Members
private

Metrics bus stream.

private

Metrics bus transformed stream.

Method Summary

Public Methods
public

fill_error(arg_response: ServiceResponse, arg_operands: array, arg_error: string, arg_op: string, arg_type: string): nothing

Populate a response with error message.

public abstract

Get provider operations names.

public

init_stream(arg_type: string): nothing

Init output stream.

public

produce(arg_request: ServiceRequest): Promise

Produce service datas on request.

Public Constructors

public constructor(arg_provider_name: string, arg_service_instance: Service, arg_context: string): nothing source

Create a metrics service provider.

Params:

NameTypeAttributeDescription
arg_provider_name string

consumer name.

arg_service_instance Service

service instance.

arg_context string

logging context label.

Return:

nothing

Public Members

public is_metrics_svc_provider: boolean source

Class test flag.

Private Members

private _metrics_bus_stream: Stream source

Metrics bus stream.

private _metrics_bus_stream_transformed: Stream source

Metrics bus transformed stream.

Public Methods

public fill_error(arg_response: ServiceResponse, arg_operands: array, arg_error: string, arg_op: string, arg_type: string): nothing source

Populate a response with error message.

Params:

NameTypeAttributeDescription
arg_response ServiceResponse

response instance.

arg_operands array

request operands.

arg_error string

error text.

arg_op string

metrics operation.

arg_type string

metrics type.

Return:

nothing

public abstract get_operations_names(): array source

Get provider operations names.

Return:

array

public init_stream(arg_type: string): nothing source

Init output stream.

Params:

NameTypeAttributeDescription
arg_type string

metrics type.

Return:

nothing

public produce(arg_request: ServiceRequest): Promise source

Produce service datas on request.

Params:

NameTypeAttributeDescription
arg_request ServiceRequest

service request instance.

Return:

Promise

promise of ServiceResponse instance.