@autofleet/nitur 1.0.0-beta.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/lib/index.d.ts +2 -0
- package/lib/index.js +24 -0
- package/lib/newrelic/index.d.ts +2 -0
- package/lib/newrelic/index.js +16 -0
- package/package.json +35 -0
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.newrelic = void 0;
|
|
23
|
+
const newrelic = __importStar(require("./newrelic"));
|
|
24
|
+
exports.newrelic = newrelic;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.stopConnectionPoolReporter = exports.connectionPoolReporter = void 0;
|
|
7
|
+
const newrelic_1 = __importDefault(require("newrelic"));
|
|
8
|
+
exports.connectionPoolReporter = (sequelize, interval = 5000) => {
|
|
9
|
+
if (newrelic_1.default) {
|
|
10
|
+
const intervalId = setInterval(() => {
|
|
11
|
+
newrelic_1.default.recordMetric('Sequelize/PendingConnections', sequelize.connectionManager.pool.pending);
|
|
12
|
+
}, interval);
|
|
13
|
+
return intervalId;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.stopConnectionPoolReporter = (intervalId) => clearInterval(intervalId);
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@autofleet/nitur",
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
|
+
"description": "A package for sevice monitoring",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rm -rf lib && tsc",
|
|
8
|
+
"prepublish": "npm run build",
|
|
9
|
+
"coverage": "jest --coverage --forceExit --runInBand",
|
|
10
|
+
"test": "jest --forceExit --runInBand",
|
|
11
|
+
"test-auto": "jest --watch --runInBand",
|
|
12
|
+
"linter": "./node_modules/.bin/eslint ."
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/Autofleet/nitur.git"
|
|
17
|
+
},
|
|
18
|
+
"author": "Itay Ankri",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/Autofleet/nitur/issues"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"newrelic": "^4.10.0",
|
|
25
|
+
"sequelize": "^6.6.2"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^14.14.20",
|
|
29
|
+
"typescript": "^3.9.5"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/Autofleet/nitur#readme",
|
|
32
|
+
"files": [
|
|
33
|
+
"lib/**/*"
|
|
34
|
+
]
|
|
35
|
+
}
|