@midwayjs/prometheus 3.0.0-alpha.42 → 3.0.0-beta.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * node v16 typings ([#1269](https://github.com/midwayjs/midway/issues/1269)) ([e3443b5](https://github.com/midwayjs/midway/commit/e3443b58fc1faddadf1e95dd03a2f319410941bb))
12
+
13
+
14
+ ### Features
15
+
16
+ * add setDiff ([#1263](https://github.com/midwayjs/midway/issues/1263)) ([9dd1a08](https://github.com/midwayjs/midway/commit/9dd1a08326540da52abf79cf31182d4e63b7f4d9))
17
+
18
+
19
+
20
+
21
+
6
22
  ## [2.12.3](https://github.com/midwayjs/midway/compare/v2.12.2...v2.12.3) (2021-08-09)
7
23
 
8
24
  **Note:** Version bump only for package @midwayjs/prometheus
@@ -1,8 +1,8 @@
1
- export declare class AutoConfiguration {
1
+ export declare class PrometheusConfiguration {
2
2
  prometheusConfig: any;
3
3
  app: any;
4
4
  http_server: any;
5
- onReady(contanier: any): Promise<void>;
5
+ onReady(): Promise<void>;
6
6
  onStop(): Promise<void>;
7
7
  }
8
8
  //# sourceMappingURL=configuration.d.ts.map
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AutoConfiguration = void 0;
12
+ exports.PrometheusConfiguration = void 0;
13
13
  const decorator_1 = require("@midwayjs/decorator");
14
14
  const path_1 = require("path");
15
15
  const PromClient = require("prom-client");
@@ -20,8 +20,8 @@ const fs = require("fs");
20
20
  const http = require("http");
21
21
  const qs = require("querystring");
22
22
  const dataService_1 = require("./service/dataService");
23
- let AutoConfiguration = class AutoConfiguration {
24
- async onReady(contanier) {
23
+ let PrometheusConfiguration = class PrometheusConfiguration {
24
+ async onReady() {
25
25
  PromClient.collectDefaultMetrics(this.prometheusConfig);
26
26
  const modules = (0, decorator_1.listModule)('prometheus:master');
27
27
  const handlers = {};
@@ -94,16 +94,16 @@ let AutoConfiguration = class AutoConfiguration {
94
94
  __decorate([
95
95
  (0, decorator_1.Config)('prometheus'),
96
96
  __metadata("design:type", Object)
97
- ], AutoConfiguration.prototype, "prometheusConfig", void 0);
97
+ ], PrometheusConfiguration.prototype, "prometheusConfig", void 0);
98
98
  __decorate([
99
99
  (0, decorator_1.App)(),
100
100
  __metadata("design:type", Object)
101
- ], AutoConfiguration.prototype, "app", void 0);
102
- AutoConfiguration = __decorate([
101
+ ], PrometheusConfiguration.prototype, "app", void 0);
102
+ PrometheusConfiguration = __decorate([
103
103
  (0, decorator_1.Configuration)({
104
104
  namespace: 'prometheus',
105
105
  importConfigs: [(0, path_1.join)(__dirname, 'config')],
106
106
  })
107
- ], AutoConfiguration);
108
- exports.AutoConfiguration = AutoConfiguration;
107
+ ], PrometheusConfiguration);
108
+ exports.PrometheusConfiguration = PrometheusConfiguration;
109
109
  //# sourceMappingURL=configuration.js.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { AutoConfiguration as Configuration } from './configuration';
1
+ export { PrometheusConfiguration as Configuration } from './configuration';
2
2
  export { DefaultMetricsCollectorConfiguration as DefaultConfig } from 'prom-client';
3
3
  export { DataService } from './service/dataService';
4
4
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DataService = exports.Configuration = void 0;
4
4
  var configuration_1 = require("./configuration");
5
- Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.AutoConfiguration; } });
5
+ Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.PrometheusConfiguration; } });
6
6
  var dataService_1 = require("./service/dataService");
7
7
  Object.defineProperty(exports, "DataService", { enumerable: true, get: function () { return dataService_1.DataService; } });
8
8
  //# sourceMappingURL=index.js.map
@@ -8,7 +8,7 @@ export declare class DataService {
8
8
  bInit: boolean;
9
9
  init(): Promise<void>;
10
10
  getUser(method: any, status: any, path: any, time: any): Promise<void>;
11
- define(name: any, type: any, options: any): Promise<void>;
11
+ define(name: any, type: any, options: any): void;
12
12
  inc(name: any, labels: any, value?: number): Promise<void>;
13
13
  set(name: any, value: any): Promise<void>;
14
14
  setDiff(name: any, diff: any): Promise<void>;
@@ -54,7 +54,7 @@ let DataService = class DataService {
54
54
  .labels(method, status, path, ...Object.values(this.prometheusConfig.labels))
55
55
  .observe(time);
56
56
  }
57
- async define(name, type, options) {
57
+ define(name, type, options) {
58
58
  options.labelNames = options.labelNames
59
59
  ? [...options.labelNames, ...Object.keys(this.prometheusConfig.labels)]
60
60
  : Object.keys(this.prometheusConfig.labels);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/prometheus",
3
- "version": "3.0.0-alpha.42",
3
+ "version": "3.0.0-beta.1",
4
4
  "description": "midway component for prometheus",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -22,10 +22,10 @@
22
22
  ],
23
23
  "license": "MIT",
24
24
  "devDependencies": {
25
- "@midwayjs/core": "^3.0.0-alpha.42",
26
- "@midwayjs/decorator": "^3.0.0-alpha.42",
27
- "@midwayjs/koa": "^3.0.0-alpha.42",
28
- "@midwayjs/mock": "^3.0.0-alpha.42",
25
+ "@midwayjs/core": "^3.0.0-beta.1",
26
+ "@midwayjs/decorator": "^3.0.0-beta.1",
27
+ "@midwayjs/koa": "^3.0.0-beta.1",
28
+ "@midwayjs/mock": "^3.0.0-beta.1",
29
29
  "@types/request": "^2.48.5"
30
30
  },
31
31
  "dependencies": {
@@ -33,7 +33,7 @@
33
33
  "request": "^2.88.2"
34
34
  },
35
35
  "engines": {
36
- "node": ">= 12.0.0"
36
+ "node": ">=12"
37
37
  },
38
- "gitHead": "e7085e10a9c715a51eaf7d251f6b8babafd1bc0e"
38
+ "gitHead": "72e4d20c678e65a5440c4e9a6d3b70046daa497c"
39
39
  }