@forge/util 1.4.2-next.0 → 1.4.3-next.0
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/CHANGELOG.md +14 -0
- package/package.json +4 -3
- package/packages/in-memory-metrics/CHANGELOG.md +13 -0
- package/packages/in-memory-metrics/README.md +18 -0
- package/packages/in-memory-metrics/dist/index.d.ts +3 -0
- package/packages/in-memory-metrics/dist/index.d.ts.map +1 -0
- package/packages/in-memory-metrics/dist/index.js +6 -0
- package/packages/in-memory-metrics/dist/index.js.map +1 -0
- package/packages/in-memory-metrics/dist/metric/counter.d.ts +11 -0
- package/packages/in-memory-metrics/dist/metric/counter.d.ts.map +1 -0
- package/packages/in-memory-metrics/dist/metric/counter.js +27 -0
- package/packages/in-memory-metrics/dist/metric/counter.js.map +1 -0
- package/packages/in-memory-metrics/dist/metric/gauge.d.ts +8 -0
- package/packages/in-memory-metrics/dist/metric/gauge.d.ts.map +1 -0
- package/packages/in-memory-metrics/dist/metric/gauge.js +18 -0
- package/packages/in-memory-metrics/dist/metric/gauge.js.map +1 -0
- package/packages/in-memory-metrics/dist/metric/metric.d.ts +9 -0
- package/packages/in-memory-metrics/dist/metric/metric.d.ts.map +1 -0
- package/packages/in-memory-metrics/dist/metric/metric.js +17 -0
- package/packages/in-memory-metrics/dist/metric/metric.js.map +1 -0
- package/packages/in-memory-metrics/dist/metric/timed.d.ts +13 -0
- package/packages/in-memory-metrics/dist/metric/timed.d.ts.map +1 -0
- package/packages/in-memory-metrics/dist/metric/timed.js +48 -0
- package/packages/in-memory-metrics/dist/metric/timed.js.map +1 -0
- package/packages/in-memory-metrics/dist/metrics.d.ts +33 -0
- package/packages/in-memory-metrics/dist/metrics.d.ts.map +1 -0
- package/packages/in-memory-metrics/dist/metrics.js +103 -0
- package/packages/in-memory-metrics/dist/metrics.js.map +1 -0
- package/packages/in-memory-metrics/package.json +31 -0
- package/packages/metrics-interface/CHANGELOG.md +6 -0
- package/packages/metrics-interface/dist/mocks/index.d.ts +16 -16
- package/packages/metrics-interface/dist/mocks/index.d.ts.map +1 -1
- package/packages/metrics-interface/package.json +1 -1
- package/scripts/build.sh +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @forge/util
|
|
2
2
|
|
|
3
|
+
## 1.4.3-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f8a4714: Use InMemoryMetrics from the Node monorepo
|
|
8
|
+
|
|
9
|
+
## 1.4.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- d76d95c: Bumping dependencies via Renovate:
|
|
14
|
+
|
|
15
|
+
- webpack
|
|
16
|
+
|
|
3
17
|
## 1.4.2-next.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/util",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3-next.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "./scripts/build.sh",
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
"author": "Daniel Winter-Wijntjes",
|
|
10
10
|
"license": "UNLICENSED",
|
|
11
11
|
"exports": {
|
|
12
|
+
"./packages/analytics-node-client": "./packages/analytics-node-client/src/index.js",
|
|
12
13
|
"./packages/ari": "./packages/ari/index.js",
|
|
13
|
-
"./packages/metrics
|
|
14
|
+
"./packages/in-memory-metrics": "./packages/in-memory-metrics/dist/index.js",
|
|
14
15
|
"./packages/logger-interface": "./packages/logger-interface/dist/index.js",
|
|
15
|
-
"./packages/
|
|
16
|
+
"./packages/metrics-interface": "./packages/metrics-interface/dist/index.js"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
19
|
"ts-is-present": "^1.2.2",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# @atlassian/in-memory-metrics
|
|
2
|
+
|
|
3
|
+
Provides an implementation of `Metrics` from `@atlassian/metrics-interface` that stores all the data in memory.
|
|
4
|
+
|
|
5
|
+
Useful in serverless environments like Forge, and for testing.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { InMemoryMetrics } from '@atlassian/in-memory-metrics';
|
|
11
|
+
|
|
12
|
+
const metrics = new InMemoryMetrics();
|
|
13
|
+
metrics.counter('one').incr();
|
|
14
|
+
// ...
|
|
15
|
+
|
|
16
|
+
const counters = metrics.getCounters();
|
|
17
|
+
// analyse or submit data elsewhere
|
|
18
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InMemoryMetrics = void 0;
|
|
4
|
+
const metrics_1 = require("./metrics");
|
|
5
|
+
Object.defineProperty(exports, "InMemoryMetrics", { enumerable: true, get: function () { return metrics_1.InMemoryMetrics; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAA4C;AAEnC,gGAFA,yBAAe,OAEA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Counter } from '@atlassian/metrics-interface';
|
|
2
|
+
import { InMemoryMetric } from './metric';
|
|
3
|
+
export declare class InMemoryCounterMetric extends InMemoryMetric implements Counter {
|
|
4
|
+
private count;
|
|
5
|
+
getCount(): number;
|
|
6
|
+
incr(): void;
|
|
7
|
+
decr(): void;
|
|
8
|
+
decrBy(val: number): void;
|
|
9
|
+
incrBy(val: number): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=counter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../src/metric/counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,qBAAa,qBAAsB,SAAQ,cAAe,YAAW,OAAO;IAC1E,OAAO,CAAC,KAAK,CAAK;IAElB,QAAQ,IAAI,MAAM;IAIlB,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;IAIZ,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIzB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAG1B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InMemoryCounterMetric = void 0;
|
|
4
|
+
const metric_1 = require("./metric");
|
|
5
|
+
class InMemoryCounterMetric extends metric_1.InMemoryMetric {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.count = 0;
|
|
9
|
+
}
|
|
10
|
+
getCount() {
|
|
11
|
+
return this.count;
|
|
12
|
+
}
|
|
13
|
+
incr() {
|
|
14
|
+
this.count++;
|
|
15
|
+
}
|
|
16
|
+
decr() {
|
|
17
|
+
this.count--;
|
|
18
|
+
}
|
|
19
|
+
decrBy(val) {
|
|
20
|
+
this.count -= val;
|
|
21
|
+
}
|
|
22
|
+
incrBy(val) {
|
|
23
|
+
this.count += val;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.InMemoryCounterMetric = InMemoryCounterMetric;
|
|
27
|
+
//# sourceMappingURL=counter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"counter.js","sourceRoot":"","sources":["../../src/metric/counter.ts"],"names":[],"mappings":";;;AAEA,qCAA0C;AAE1C,MAAa,qBAAsB,SAAQ,uBAAc;IAAzD;;QACU,UAAK,GAAG,CAAC,CAAC;IAqBpB,CAAC;IAnBC,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,IAAI;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC;IACpB,CAAC;CACF;AAtBD,sDAsBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Gauge } from '@atlassian/metrics-interface';
|
|
2
|
+
import { InMemoryMetric } from './metric';
|
|
3
|
+
export declare class InMemoryGaugeMetric extends InMemoryMetric implements Gauge {
|
|
4
|
+
private value;
|
|
5
|
+
getValue(): number;
|
|
6
|
+
set(val: number): void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=gauge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gauge.d.ts","sourceRoot":"","sources":["../../src/metric/gauge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,qBAAa,mBAAoB,SAAQ,cAAe,YAAW,KAAK;IACtE,OAAO,CAAC,KAAK,CAAK;IAElB,QAAQ,IAAI,MAAM;IAIlB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAGvB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InMemoryGaugeMetric = void 0;
|
|
4
|
+
const metric_1 = require("./metric");
|
|
5
|
+
class InMemoryGaugeMetric extends metric_1.InMemoryMetric {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.value = 0;
|
|
9
|
+
}
|
|
10
|
+
getValue() {
|
|
11
|
+
return this.value;
|
|
12
|
+
}
|
|
13
|
+
set(val) {
|
|
14
|
+
this.value = val;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.InMemoryGaugeMetric = InMemoryGaugeMetric;
|
|
18
|
+
//# sourceMappingURL=gauge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gauge.js","sourceRoot":"","sources":["../../src/metric/gauge.ts"],"names":[],"mappings":";;;AAEA,qCAA0C;AAE1C,MAAa,mBAAoB,SAAQ,uBAAc;IAAvD;;QACU,UAAK,GAAG,CAAC,CAAC;IASpB,CAAC;IAPC,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,GAAG,CAAC,GAAW;QACb,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;IACnB,CAAC;CACF;AAVD,kDAUC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Tags } from '@atlassian/metrics-interface';
|
|
2
|
+
export declare abstract class InMemoryMetric {
|
|
3
|
+
protected readonly name: string;
|
|
4
|
+
protected additionalInfo?: Tags | undefined;
|
|
5
|
+
constructor(name: string, additionalInfo?: Tags | undefined);
|
|
6
|
+
getName(): string;
|
|
7
|
+
getTags(): Tags;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=metric.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metric.d.ts","sourceRoot":"","sources":["../../src/metric/metric.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEpD,8BAAsB,cAAc;IACtB,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAE,SAAS,CAAC,cAAc,CAAC;gBAAvC,IAAI,EAAE,MAAM,EAAY,cAAc,CAAC,kBAAM;IAE5E,OAAO,IAAI,MAAM;IAIjB,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InMemoryMetric = void 0;
|
|
4
|
+
class InMemoryMetric {
|
|
5
|
+
constructor(name, additionalInfo) {
|
|
6
|
+
this.name = name;
|
|
7
|
+
this.additionalInfo = additionalInfo;
|
|
8
|
+
}
|
|
9
|
+
getName() {
|
|
10
|
+
return this.name;
|
|
11
|
+
}
|
|
12
|
+
getTags() {
|
|
13
|
+
return this.additionalInfo || {};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.InMemoryMetric = InMemoryMetric;
|
|
17
|
+
//# sourceMappingURL=metric.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metric.js","sourceRoot":"","sources":["../../src/metric/metric.ts"],"names":[],"mappings":";;;AAEA,MAAsB,cAAc;IAClC,YAA+B,IAAY,EAAY,cAAqB;QAA7C,SAAI,GAAJ,IAAI,CAAQ;QAAY,mBAAc,GAAd,cAAc,CAAO;IAAG,CAAC;IAEhF,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC;IACnC,CAAC;CACF;AAVD,wCAUC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Tags, Timing } from '@atlassian/metrics-interface';
|
|
2
|
+
import { InMemoryMetric } from './metric';
|
|
3
|
+
export declare class InMemoryTimedMetric extends InMemoryMetric implements Timing {
|
|
4
|
+
private latency;
|
|
5
|
+
private started;
|
|
6
|
+
private startedAt;
|
|
7
|
+
getTime(): number;
|
|
8
|
+
private format;
|
|
9
|
+
private stopTimer;
|
|
10
|
+
measure(): Timing.Stop;
|
|
11
|
+
set(val: number, extraTags?: Tags): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=timed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timed.d.ts","sourceRoot":"","sources":["../../src/metric/timed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAiB,MAAM,8BAA8B,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI1C,qBAAa,mBAAoB,SAAQ,cAAe,YAAW,MAAM;IACvE,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAa;IAEvB,OAAO,IAAI,MAAM;IAOxB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,SAAS;IAMV,OAAO,IAAI,MAAM,CAAC,IAAI;IAWtB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI;CAShD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InMemoryTimedMetric = void 0;
|
|
4
|
+
const metric_1 = require("./metric");
|
|
5
|
+
const MILLISEC_TO_NANOSEC = 1000000;
|
|
6
|
+
class InMemoryTimedMetric extends metric_1.InMemoryMetric {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.latency = 0;
|
|
10
|
+
this.started = false;
|
|
11
|
+
this.startedAt = BigInt(0);
|
|
12
|
+
}
|
|
13
|
+
getTime() {
|
|
14
|
+
if (this.started) {
|
|
15
|
+
this.stopTimer();
|
|
16
|
+
}
|
|
17
|
+
return this.format(this.latency);
|
|
18
|
+
}
|
|
19
|
+
format(input, opts) {
|
|
20
|
+
return parseFloat(input.toFixed(opts?.precision || 2));
|
|
21
|
+
}
|
|
22
|
+
stopTimer(extraTags) {
|
|
23
|
+
const latency = process.hrtime.bigint() - this.startedAt;
|
|
24
|
+
this.started = false;
|
|
25
|
+
this.set(Number(latency) / MILLISEC_TO_NANOSEC, extraTags);
|
|
26
|
+
}
|
|
27
|
+
measure() {
|
|
28
|
+
this.startedAt = process.hrtime.bigint();
|
|
29
|
+
this.started = true;
|
|
30
|
+
return {
|
|
31
|
+
stop: (extraTags, opts) => {
|
|
32
|
+
this.stopTimer(extraTags);
|
|
33
|
+
return this.format(this.latency, opts);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
set(val, extraTags) {
|
|
38
|
+
this.latency = val;
|
|
39
|
+
if (extraTags) {
|
|
40
|
+
this.additionalInfo = {
|
|
41
|
+
...this.additionalInfo,
|
|
42
|
+
...extraTags,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.InMemoryTimedMetric = InMemoryTimedMetric;
|
|
48
|
+
//# sourceMappingURL=timed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timed.js","sourceRoot":"","sources":["../../src/metric/timed.ts"],"names":[],"mappings":";;;AAEA,qCAA0C;AAE1C,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAEpC,MAAa,mBAAoB,SAAQ,uBAAc;IAAvD;;QACU,YAAO,GAAG,CAAC,CAAC;QACZ,YAAO,GAAG,KAAK,CAAC;QAChB,cAAS,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAuChC,CAAC;IArCQ,OAAO;QACZ,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,SAAS,EAAE,CAAC;SAClB;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAEO,MAAM,CAAC,KAAa,EAAE,IAAoB;QAChD,OAAO,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;IAEO,SAAS,CAAC,SAAgB;QAChC,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QACzD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,mBAAmB,EAAE,SAAS,CAAC,CAAC;IAC7D,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,OAAO;YACL,IAAI,EAAE,CAAC,SAAgB,EAAE,IAAoB,EAAU,EAAE;gBACvD,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;gBAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzC,CAAC;SACF,CAAC;IACJ,CAAC;IAEM,GAAG,CAAC,GAAW,EAAE,SAAgB;QACtC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACnB,IAAI,SAAS,EAAE;YACb,IAAI,CAAC,cAAc,GAAG;gBACpB,GAAG,IAAI,CAAC,cAAc;gBACtB,GAAG,SAAS;aACb,CAAC;SACH;IACH,CAAC;CACF;AA1CD,kDA0CC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Counter, Gauge, Metrics, Tags, Timing } from '@atlassian/metrics-interface';
|
|
2
|
+
import { InMemoryCounterMetric } from './metric/counter';
|
|
3
|
+
import { InMemoryGaugeMetric } from './metric/gauge';
|
|
4
|
+
import { InMemoryMetric } from './metric/metric';
|
|
5
|
+
import { InMemoryTimedMetric } from './metric/timed';
|
|
6
|
+
/**
|
|
7
|
+
* Metrics class that keeps results in memory, for use in Forge Runtime and
|
|
8
|
+
* testing.
|
|
9
|
+
*/
|
|
10
|
+
export declare class InMemoryMetrics extends InMemoryMetric implements Metrics {
|
|
11
|
+
private readonly _timers;
|
|
12
|
+
private readonly _counters;
|
|
13
|
+
private readonly _gauges;
|
|
14
|
+
private readonly _children;
|
|
15
|
+
constructor(tags?: Tags, name?: string);
|
|
16
|
+
getTimers(): InMemoryTimedMetric[];
|
|
17
|
+
getCounters(): Map<string, InMemoryCounterMetric>;
|
|
18
|
+
getGauges(): Map<string, InMemoryGaugeMetric>;
|
|
19
|
+
getChildren(): Map<string, InMemoryMetrics>;
|
|
20
|
+
private tagsWith;
|
|
21
|
+
private getHashedMetricName;
|
|
22
|
+
child(name: string, tags?: Tags): InMemoryMetrics;
|
|
23
|
+
counter(name: string, tags?: Tags): Counter;
|
|
24
|
+
counterByName(name: string): InMemoryCounterMetric;
|
|
25
|
+
gauge(name: string, tags?: Tags): Gauge;
|
|
26
|
+
gaugeByName(name: string): InMemoryGaugeMetric;
|
|
27
|
+
timerByName(name: string): InMemoryTimedMetric;
|
|
28
|
+
timing(name: string, tags?: Tags): Timing;
|
|
29
|
+
event(_title: string, _description?: string): void;
|
|
30
|
+
set(_name: string, _tags?: Tags | undefined): never;
|
|
31
|
+
histogram(_name: string, _buckets: number[], _tags?: Tags | undefined): never;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAErF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAA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G,SAAS,GAAG,KAAK;IAKnD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,KAAK;CAG9E"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InMemoryMetrics = void 0;
|
|
4
|
+
const counter_1 = require("./metric/counter");
|
|
5
|
+
const gauge_1 = require("./metric/gauge");
|
|
6
|
+
const metric_1 = require("./metric/metric");
|
|
7
|
+
const timed_1 = require("./metric/timed");
|
|
8
|
+
/**
|
|
9
|
+
* Metrics class that keeps results in memory, for use in Forge Runtime and
|
|
10
|
+
* testing.
|
|
11
|
+
*/
|
|
12
|
+
class InMemoryMetrics extends metric_1.InMemoryMetric {
|
|
13
|
+
constructor(tags, name = '') {
|
|
14
|
+
super(name, tags);
|
|
15
|
+
this._timers = [];
|
|
16
|
+
this._counters = new Map();
|
|
17
|
+
this._gauges = new Map();
|
|
18
|
+
this._children = new Map();
|
|
19
|
+
}
|
|
20
|
+
getTimers() {
|
|
21
|
+
return this._timers;
|
|
22
|
+
}
|
|
23
|
+
getCounters() {
|
|
24
|
+
return this._counters;
|
|
25
|
+
}
|
|
26
|
+
getGauges() {
|
|
27
|
+
return this._gauges;
|
|
28
|
+
}
|
|
29
|
+
getChildren() {
|
|
30
|
+
return this._children;
|
|
31
|
+
}
|
|
32
|
+
tagsWith(tags) {
|
|
33
|
+
return { ...this.getTags(), ...tags };
|
|
34
|
+
}
|
|
35
|
+
getHashedMetricName(name, tags) {
|
|
36
|
+
const sortedTags = Object.entries(this.tagsWith(tags)).sort();
|
|
37
|
+
return `${name}_${JSON.stringify(sortedTags)}`;
|
|
38
|
+
}
|
|
39
|
+
child(name, tags) {
|
|
40
|
+
const hashedMetricName = this.getHashedMetricName(name, tags);
|
|
41
|
+
if (!this._children.has(hashedMetricName)) {
|
|
42
|
+
const child = new InMemoryMetrics(this.tagsWith(tags), name);
|
|
43
|
+
this._children.set(hashedMetricName, child);
|
|
44
|
+
}
|
|
45
|
+
return this._children.get(hashedMetricName);
|
|
46
|
+
}
|
|
47
|
+
counter(name, tags) {
|
|
48
|
+
const hashedMetricName = this.getHashedMetricName(name, tags);
|
|
49
|
+
if (!this._counters.has(hashedMetricName)) {
|
|
50
|
+
const counter = new counter_1.InMemoryCounterMetric(name, this.tagsWith(tags));
|
|
51
|
+
this._counters.set(hashedMetricName, counter);
|
|
52
|
+
}
|
|
53
|
+
return this._counters.get(hashedMetricName);
|
|
54
|
+
}
|
|
55
|
+
counterByName(name) {
|
|
56
|
+
const filteredMetrics = Array.from(this.getCounters().values()).filter(v => v.getName() === name);
|
|
57
|
+
if (filteredMetrics.length !== 1) {
|
|
58
|
+
throw new Error(`Expected to find a single counter with name ${name}, but found ${filteredMetrics.length}`);
|
|
59
|
+
}
|
|
60
|
+
return filteredMetrics[0];
|
|
61
|
+
}
|
|
62
|
+
gauge(name, tags) {
|
|
63
|
+
const hashedMetricName = this.getHashedMetricName(name, tags);
|
|
64
|
+
if (!this._gauges.has(hashedMetricName)) {
|
|
65
|
+
const gauge = new gauge_1.InMemoryGaugeMetric(name, this.tagsWith(tags));
|
|
66
|
+
this._gauges.set(hashedMetricName, gauge);
|
|
67
|
+
}
|
|
68
|
+
return this._gauges.get(hashedMetricName);
|
|
69
|
+
}
|
|
70
|
+
gaugeByName(name) {
|
|
71
|
+
const filteredMetrics = Array.from(this.getGauges().values()).filter(v => v.getName() === name);
|
|
72
|
+
if (filteredMetrics.length !== 1) {
|
|
73
|
+
throw new Error(`Expected to find a single gauge with name ${name}, but found ${filteredMetrics.length}`);
|
|
74
|
+
}
|
|
75
|
+
return filteredMetrics[0];
|
|
76
|
+
}
|
|
77
|
+
timerByName(name) {
|
|
78
|
+
const timer = this._timers.find(t => t.getName() === name);
|
|
79
|
+
if (!timer) {
|
|
80
|
+
throw new Error(`Failed to find timer with name ${name}`);
|
|
81
|
+
}
|
|
82
|
+
return timer;
|
|
83
|
+
}
|
|
84
|
+
timing(name, tags) {
|
|
85
|
+
const timer = new timed_1.InMemoryTimedMetric(name, this.tagsWith(tags));
|
|
86
|
+
this._timers.push(timer);
|
|
87
|
+
return timer;
|
|
88
|
+
}
|
|
89
|
+
/* istanbul ignore next */
|
|
90
|
+
event(_title, _description) {
|
|
91
|
+
throw new Error('Events are not implemented.');
|
|
92
|
+
}
|
|
93
|
+
/* istanbul ignore next */
|
|
94
|
+
set(_name, _tags) {
|
|
95
|
+
throw new Error('Sets are not implemented.');
|
|
96
|
+
}
|
|
97
|
+
/* istanbul ignore next */
|
|
98
|
+
histogram(_name, _buckets, _tags) {
|
|
99
|
+
throw new Error('Histograms are not implemented.');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.InMemoryMetrics = InMemoryMetrics;
|
|
103
|
+
//# sourceMappingURL=metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":";;;AAEA,8CAAyD;AACzD,0CAAqD;AACrD,4CAAiD;AACjD,0CAAqD;AAErD;;;GAGG;AACH,MAAa,eAAgB,SAAQ,uBAAc;IAMjD,YAAY,IAAW,EAAE,IAAI,GAAG,EAAE;QAChC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QANH,YAAO,GAA0B,EAAE,CAAC;QACpC,cAAS,GAAuC,IAAI,GAAG,EAAE,CAAC;QAC1D,YAAO,GAAqC,IAAI,GAAG,EAAE,CAAC;QACtD,cAAS,GAAiC,IAAI,GAAG,EAAE,CAAC;IAIrE,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,OAAO,CAAC;IACt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KAAK,CAAC,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,6CAA6C,IAAI,eAAe,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC;SAC3G;QACD,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,EAAE,CAAC,CAAC;SAC3D;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,IAAW;QAC9B,MAAM,KAAK,GAAG,IAAI,2BAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0BAA0B;IAC1B,KAAK,CAAC,MAAc,EAAE,YAAqB;QACzC,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,0BAA0B;IAC1B,GAAG,CAAC,KAAa,EAAE,KAAwB;QACzC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,CAAC;IAED,0BAA0B;IAC1B,SAAS,CAAC,KAAa,EAAE,QAAkB,EAAE,KAAwB;QACnE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;CACF;AA1GD,0CA0GC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "in-memory-metrics",
|
|
3
|
+
"description": "Metrics implementation that stores metrics in memory",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"main": "dist/index",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@atlassian/metrics-interface": "^4.0.0"
|
|
8
|
+
},
|
|
9
|
+
"devDependencies": {},
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"typings": "dist/index.d.ts",
|
|
12
|
+
"config": {
|
|
13
|
+
"registry": "atlassian",
|
|
14
|
+
"isPlatformPackage": true,
|
|
15
|
+
"isStarterPackage": true
|
|
16
|
+
},
|
|
17
|
+
"license": "Proprietary",
|
|
18
|
+
"repository": {
|
|
19
|
+
"directory": "src/packages/metrics/in-memory-metrics",
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git@bitbucket.org:atlassian/node-monorepo.git"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://bitbucket.org/atlassian/node-monorepo/src/master/src/packages/metrics/in-memory-metrics",
|
|
24
|
+
"files": [
|
|
25
|
+
"bin/",
|
|
26
|
+
"dist/",
|
|
27
|
+
"package.json",
|
|
28
|
+
"CHANGELOG.md",
|
|
29
|
+
"README.md"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -3,41 +3,41 @@ import { Counter, Gauge, Metrics, Set, Tags, Timing } from '../index';
|
|
|
3
3
|
export declare class MockCounter implements Counter {
|
|
4
4
|
name: string;
|
|
5
5
|
tags?: Tags | undefined;
|
|
6
|
-
incr: jest.Mock<any, any>;
|
|
7
|
-
decr: jest.Mock<any, any>;
|
|
8
|
-
incrBy: jest.Mock<any, any>;
|
|
9
|
-
decrBy: jest.Mock<any, any>;
|
|
6
|
+
incr: jest.Mock<any, any, any>;
|
|
7
|
+
decr: jest.Mock<any, any, any>;
|
|
8
|
+
incrBy: jest.Mock<any, any, any>;
|
|
9
|
+
decrBy: jest.Mock<any, any, any>;
|
|
10
10
|
constructor(name: string, tags?: Tags | undefined);
|
|
11
11
|
}
|
|
12
12
|
export declare class MockGauge implements Gauge {
|
|
13
13
|
name: string;
|
|
14
14
|
tags?: Tags | undefined;
|
|
15
|
-
set: jest.Mock<any, any>;
|
|
15
|
+
set: jest.Mock<any, any, any>;
|
|
16
16
|
constructor(name: string, tags?: Tags | undefined);
|
|
17
17
|
}
|
|
18
18
|
export declare class MockSet implements Set {
|
|
19
19
|
name: string;
|
|
20
20
|
tags?: Tags | undefined;
|
|
21
|
-
add: jest.Mock<any, any>;
|
|
21
|
+
add: jest.Mock<any, any, any>;
|
|
22
22
|
constructor(name: string, tags?: Tags | undefined);
|
|
23
23
|
}
|
|
24
24
|
export declare class MockTiming implements Timing {
|
|
25
25
|
name: string;
|
|
26
26
|
tags?: Tags | undefined;
|
|
27
27
|
buckets?: number[] | undefined;
|
|
28
|
-
set: jest.Mock<any, any>;
|
|
28
|
+
set: jest.Mock<any, any, any>;
|
|
29
29
|
measure: jest.Mock<{
|
|
30
|
-
stop: jest.Mock<any, any>;
|
|
31
|
-
}, []>;
|
|
30
|
+
stop: jest.Mock<any, any, any>;
|
|
31
|
+
}, [], any>;
|
|
32
32
|
constructor(name: string, tags?: Tags | undefined, buckets?: number[] | undefined);
|
|
33
33
|
}
|
|
34
34
|
export declare class MockMetrics implements Metrics {
|
|
35
|
-
child: jest.Mock<MockMetrics, []>;
|
|
36
|
-
counter: jest.Mock<MockCounter, [name: any, tags: any]>;
|
|
37
|
-
gauge: jest.Mock<MockGauge, [name: any, tags: any]>;
|
|
38
|
-
set: jest.Mock<MockSet, [name: any, tags: any]>;
|
|
39
|
-
timing: jest.Mock<MockTiming, [name: any, tags: any]>;
|
|
40
|
-
histogram: jest.Mock<MockTiming, [name: any, buckets: any, tags: any]>;
|
|
41
|
-
event: jest.Mock<any, any>;
|
|
35
|
+
child: jest.Mock<MockMetrics, [], any>;
|
|
36
|
+
counter: jest.Mock<MockCounter, [name: any, tags: any], any>;
|
|
37
|
+
gauge: jest.Mock<MockGauge, [name: any, tags: any], any>;
|
|
38
|
+
set: jest.Mock<MockSet, [name: any, tags: any], any>;
|
|
39
|
+
timing: jest.Mock<MockTiming, [name: any, tags: any], any>;
|
|
40
|
+
histogram: jest.Mock<MockTiming, [name: any, buckets: any, tags: any], any>;
|
|
41
|
+
event: jest.Mock<any, any, any>;
|
|
42
42
|
}
|
|
43
43
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEtE,qBAAa,WAAY,YAAW,OAAO;IAKtB,IAAI,EAAE,MAAM;IAAS,IAAI,CAAC;IAJ7C,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEtE,qBAAa,WAAY,YAAW,OAAO;IAKtB,IAAI,EAAE,MAAM;IAAS,IAAI,CAAC;IAJ7C,IAAI,2BAAa;IACjB,IAAI,2BAAa;IACjB,MAAM,2BAAa;IACnB,MAAM,2BAAa;gBACA,IAAI,EAAE,MAAM,EAAS,IAAI,CAAC,kBAAM;CACpD;AAED,qBAAa,SAAU,YAAW,KAAK;IAElB,IAAI,EAAE,MAAM;IAAS,IAAI,CAAC;IAD7C,GAAG,2BAAa;gBACG,IAAI,EAAE,MAAM,EAAS,IAAI,CAAC,kBAAM;CACpD;AAED,qBAAa,OAAQ,YAAW,GAAG;IAEd,IAAI,EAAE,MAAM;IAAS,IAAI,CAAC;IAD7C,GAAG,2BAAa;gBACG,IAAI,EAAE,MAAM,EAAS,IAAI,CAAC,kBAAM;CACpD;AAED,qBAAa,UAAW,YAAW,MAAM;IAGpB,IAAI,EAAE,MAAM;IAAS,IAAI,CAAC;IAAe,OAAO,CAAC;IAFpE,GAAG,2BAAa;IAChB,OAAO;;gBAAwC;gBAC5B,IAAI,EAAE,MAAM,EAAS,IAAI,CAAC,kBAAM,EAAS,OAAO,CAAC,sBAAU;CAC/E;AAGD,qBAAa,WAAY,YAAW,OAAO;IACzC,KAAK,kCAAoC;IACzC,OAAO,sDAAwD;IAC/D,KAAK,oDAAsD;IAC3D,GAAG,kDAAoD;IACvD,MAAM,qDAAuD;IAC7D,SAAS,mEAAyE;IAClF,KAAK,2BAAa;CACnB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metrics-interface",
|
|
3
3
|
"description": "This module just exports an interface that provides better interoperability for TypeScript services that use any kind of metrics",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
7
7
|
"name": "Callum Osmotherly",
|
package/scripts/build.sh
CHANGED
|
@@ -20,7 +20,8 @@ add-package () {
|
|
|
20
20
|
|
|
21
21
|
add-package @atlassian/ari
|
|
22
22
|
add-package @atlassian/logger-interface
|
|
23
|
-
add-package @
|
|
23
|
+
add-package @atlassian/in-memory-metrics
|
|
24
24
|
add-package @atlassian/metrics-interface
|
|
25
|
+
add-package @atlassiansox/analytics-node-client
|
|
25
26
|
|
|
26
27
|
node ./scripts/replace-packages.js
|