@quanticjs/metrics 2.1.0 → 3.0.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.
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { Result, PipelineBehavior
|
|
1
|
+
import { Result, PipelineBehavior } from '@quanticjs/core';
|
|
2
2
|
import { MetricsService } from './MetricsService';
|
|
3
3
|
export declare class PerformanceBehavior implements PipelineBehavior {
|
|
4
4
|
private readonly metrics?;
|
|
5
|
-
readonly order: 20;
|
|
6
|
-
readonly scope: PipelineScope;
|
|
7
5
|
private readonly logger;
|
|
8
6
|
constructor(metrics?: MetricsService | undefined);
|
|
9
7
|
execute<T>(command: object, next: () => Promise<Result<T>>): Promise<Result<T>>;
|
|
@@ -19,8 +19,6 @@ const MetricsService_1 = require("./MetricsService");
|
|
|
19
19
|
const SLOW_THRESHOLD_MS = 500;
|
|
20
20
|
let PerformanceBehavior = class PerformanceBehavior {
|
|
21
21
|
metrics;
|
|
22
|
-
order = core_1.BehaviorOrder.PERFORMANCE;
|
|
23
|
-
scope = 'both';
|
|
24
22
|
logger = new common_1.Logger('PerformanceBehavior');
|
|
25
23
|
constructor(metrics) {
|
|
26
24
|
this.metrics = metrics;
|
|
@@ -48,6 +46,7 @@ let PerformanceBehavior = class PerformanceBehavior {
|
|
|
48
46
|
exports.PerformanceBehavior = PerformanceBehavior;
|
|
49
47
|
exports.PerformanceBehavior = PerformanceBehavior = __decorate([
|
|
50
48
|
(0, common_1.Injectable)(),
|
|
49
|
+
(0, core_1.Behavior)({ order: core_1.BehaviorOrder.PERFORMANCE, scope: 'both' }),
|
|
51
50
|
__param(0, (0, common_1.Optional)()),
|
|
52
51
|
__metadata("design:paramtypes", [MetricsService_1.MetricsService])
|
|
53
52
|
], PerformanceBehavior);
|
|
@@ -9,7 +9,6 @@ var QuanticMetricsModule_1;
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.QuanticMetricsModule = void 0;
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
|
-
const core_1 = require("@quanticjs/core");
|
|
13
12
|
const MetricsService_1 = require("./MetricsService");
|
|
14
13
|
const MetricsController_1 = require("./MetricsController");
|
|
15
14
|
const PerformanceBehavior_1 = require("./PerformanceBehavior");
|
|
@@ -21,7 +20,6 @@ let QuanticMetricsModule = QuanticMetricsModule_1 = class QuanticMetricsModule {
|
|
|
21
20
|
providers: [
|
|
22
21
|
MetricsService_1.MetricsService,
|
|
23
22
|
PerformanceBehavior_1.PerformanceBehavior,
|
|
24
|
-
{ provide: core_1.PIPELINE_BEHAVIOR, useExisting: PerformanceBehavior_1.PerformanceBehavior, multi: true },
|
|
25
23
|
],
|
|
26
24
|
exports: [
|
|
27
25
|
MetricsService_1.MetricsService,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quanticjs/metrics",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Prometheus metrics for quanticjs — handler duration, custom counters",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clean": "rm -rf dist"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@quanticjs/core": "^
|
|
21
|
+
"@quanticjs/core": "^3.0.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@nestjs/common": "^11.0.0",
|