Constructor
new RedisMetrics(configopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
<optional> |
configuration options Properties
|
- Source:
Example
const metrics = new RedisMetrics();
metrics.client.on('error', console.error);
metrics.counter('coolCounter').incr(1);
Members
client :Object
The client connection
Type:
- Object
- Source:
Methods
counter(eventName, optionsopt) → {TimestampedCounter}
Returns a timestamped counter for the given event.
If the counter is initialized without options, it works like a normal event counter that tracks a total count for the given event key. If a time granularity option is specified, the counter will be able to report aggregated counters based on time intervals down to the level of granularity that is chosen.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eventName |
string | The event that we want to count for. |
||||||||||||||||
options |
Object |
<optional> |
The options to use for the counter Properties
|
- Since:
- 0.1.0
- Source:
Returns:
- Type
- TimestampedCounter