Creates a new instance of the performance counters.
Closes component and frees used resources.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Configures component by passing configuration parameters.
configuration parameters to be set.
Checks if the component is opened.
true if the component has been opened and false otherwise.
Opens the component.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Saves the current counters measurements.
current counters measurements to be saves.
Sets references to dependent components.
references to locate the component dependencies.
Generated using TypeDoc
Performance counters that send their metrics to Prometheus service.
The component is normally used in passive mode conjunction with PrometheusMetricsService. Alternatively when connection parameters are set it can push metrics to Prometheus PushGateway.
Configuration parameters
References
*:logger:*:*:1.0
(optional) ILogger components to pass log messages*:counters:*:*:1.0
(optional) ICounters components to pass collected measurements*:discovery:*:*:1.0
(optional) IDiscovery services to resolve connectionRestService
CommandableHttpService
Example
let counters = new PrometheusCounters(); counters.configure(ConfigParams.fromTuples( "connection.protocol", "http", "connection.host", "localhost", "connection.port", 8080 )); counters.open("123", (err) => { ... }); counters.increment("mycomponent.mymethod.calls"); let timing = counters.beginTiming("mycomponent.mymethod.exec_time"); try { ... } finally { timing.endTiming(); } counters.dump();