@emartech/aggregate-metric-logger 2.0.1 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@ aggregate metrics in memory and log them every minute
4
4
  ## Setup
5
5
 
6
6
  Set `METRIC_LOGGER_ENABLED` env variable to `true` for aggregate-metric-logger to
7
- start collecting and logging measuremnts.
7
+ start collecting and logging measurements.
8
8
 
9
9
  To change the default `aggregate-metric-logger` namespace used for logs, set
10
10
  `METRIC_LOGGER_NAMESPACE` to a custom value.
@@ -19,7 +19,7 @@ an extra `count` property to the logs and log them at the end of the minute with
19
19
  `@emartech/json-logger`.
20
20
 
21
21
  ```js
22
- const metrictLogger = require('aggregate-metric-logger')
22
+ const metricLogger = require('@emartech/aggregate-metric-logger')
23
23
 
24
24
  metricLogger.warn('etwas-went-wrong', { customer_id: 11 });
25
25
  metricLogger.warn('etwas-went-wrong', { customer_id: 11 });
@@ -33,7 +33,7 @@ If you want aggregate measurements about something you need to simply call the `
33
33
  for each value:
34
34
 
35
35
  ```js
36
- const metrictLogger = require('aggregate-metric-logger')
36
+ const metricLogger = require('@emartech/aggregate-metric-logger')
37
37
 
38
38
  metricLogger.measure('thing-to-measure', 14)
39
39
  metricLogger.measure('thing-to-measure', 20)
@@ -61,10 +61,10 @@ function exampleIOHeavyFunction() {
61
61
  ### Group by extra parameters
62
62
 
63
63
  If you want to group by additional parameters inside a tag, you can pass down these extra
64
- params in an object to `count` and `start` as the last optional argument:
64
+ params in an object to `measure` and `start` as the last optional argument:
65
65
 
66
66
  ```js
67
- metricLogger.count('thing-to-count', 14, { customer_id: 12 });
67
+ metricLogger.measure('thing-to-count', 14, { customer_id: 12 });
68
68
 
69
69
  const measurement = metricLogger.start(
70
70
  'tag-for-the-measuement',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emartech/aggregate-metric-logger",
3
- "version": "2.0.1",
3
+ "version": "2.0.4",
4
4
  "description": "aggregate metrics in memory for logging",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -137,9 +137,9 @@ describe('metricLogger', () => {
137
137
 
138
138
  describe('start/stop', () => {
139
139
  it('should log min, max, count and sum when log was called only once', () => {
140
- const measurementId = metricLogger.start('utlegeles');
140
+ const measurement = metricLogger.start('utlegeles');
141
141
  clock.tick(50);
142
- metricLogger.stop(measurementId);
142
+ metricLogger.stop(measurement);
143
143
 
144
144
  clock.tick(60 * 1000);
145
145
  expect(Logger.prototype.info).toBeCalledWith('utlegeles', {