@emartech/aggregate-metric-logger 6.0.0 → 6.0.1

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.
Files changed (3) hide show
  1. package/.nvmrc +1 -1
  2. package/package.json +3 -2
  3. package/src/index.d.ts +30 -0
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- v20.14.0
1
+ 20.19.2
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@emartech/aggregate-metric-logger",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "aggregate metrics in memory for logging",
5
5
  "main": "src/index.js",
6
+ "types": "src/index.d.ts",
6
7
  "scripts": {
7
8
  "test": "npm run lint && npm run test:once",
8
9
  "lint": "eslint src/",
@@ -40,7 +41,7 @@
40
41
  "@types/jest": "^29.5.12",
41
42
  "dotenv-haphap": "^3.1.2",
42
43
  "eslint": "^9.7.0",
43
- "globals": "16.0.0",
44
+ "globals": "16.2.0",
44
45
  "jest": "^29.2.2",
45
46
  "semantic-release": "^24.0.0"
46
47
  }
package/src/index.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ export function count(
2
+ metricName: string,
3
+ labels: MetricLabels,
4
+ value: number
5
+ ): void;
6
+
7
+ export function measure(
8
+ metricName: string,
9
+ labels: MetricLabels,
10
+ value: number
11
+ ): void;
12
+
13
+ export function start(
14
+ metricName: string,
15
+ labels: MetricLabels
16
+ ): MetricTimerObject;
17
+
18
+ export function stop(
19
+ measurement: MetricTimerObject
20
+ ): void;
21
+
22
+ export type MetricLabels = {
23
+ [key: string]: string | number | null | undefined
24
+ };
25
+
26
+ export type MetricTimerObject = {
27
+ metricName: string,
28
+ labels: MetricLabels
29
+ start: number
30
+ };