Creates a new instance of this 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 periodically dumps counters to AWS Cloud Watch Metrics.
Configuration parameters
References
*:context-info:*:*:1.0
(optional) ContextInfo to detect the context id and specify counters source*:discovery:*:*:1.0
(optional) IDiscovery services to resolve connections*:credential-store:*:*:1.0
(optional) Credential stores to resolve credentialsCounter (in the Pip.Services components package)
CachedCounters (in the Pip.Services components package)
CompositeLogger (in the Pip.Services components package)
Example
let counters = new CloudWatchCounters(); counters.config(ConfigParams.fromTuples( "connection.region", "us-east-1", "connection.access_id", "XXXXXXXXXXX", "connection.access_key", "XXXXXXXXXXX" )); counters.setReferences(References.fromTuples( new Descriptor("pip-services", "logger", "console", "default", "1.0"), new ConsoleLogger() )); counters.open("123", (err) => { ... }); counters.increment("mycomponent.mymethod.calls"); let timing = counters.beginTiming("mycomponent.mymethod.exec_time"); try { ... } finally { timing.endTiming(); } counters.dump();