Просмотр исходного кода

[misc] bump metrics module to 3.4.1

- renamed package from `metrics-sharelatex` to `@overleaf/metrics`
- drop support for statsd backend
- decaffeinate
- compress `/metrics` response using gzip
- bump debugging agents to latest versions
- expose prometheus interfaces for custom metrics (custom tags)
- cleanup of open sockets metrics
- fix deprecation warnings for header access
Jakob Ackermann 5 лет назад
Родитель
Сommit
f16fbdcdbf

+ 1 - 1
services/notifications/app.js

@@ -5,7 +5,7 @@
  * DS207: Consider shorter variations of null checks
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  */
  */
-const metrics = require('metrics-sharelatex')
+const metrics = require('@overleaf/metrics')
 metrics.initialize('notifications')
 metrics.initialize('notifications')
 const Settings = require('settings-sharelatex')
 const Settings = require('settings-sharelatex')
 const logger = require('logger-sharelatex')
 const logger = require('logger-sharelatex')

+ 1 - 1
services/notifications/app/js/Notifications.js

@@ -14,7 +14,7 @@
 let Notifications
 let Notifications
 const logger = require('logger-sharelatex')
 const logger = require('logger-sharelatex')
 const { db, ObjectId } = require('./mongodb')
 const { db, ObjectId } = require('./mongodb')
-const metrics = require('metrics-sharelatex')
+const metrics = require('@overleaf/metrics')
 
 
 module.exports = Notifications = {
 module.exports = Notifications = {
   getUserNotifications(user_id, callback) {
   getUserNotifications(user_id, callback) {

+ 1 - 1
services/notifications/app/js/NotificationsController.js

@@ -12,7 +12,7 @@
  */
  */
 const Notifications = require('./Notifications')
 const Notifications = require('./Notifications')
 const logger = require('logger-sharelatex')
 const logger = require('logger-sharelatex')
-const metrics = require('metrics-sharelatex')
+const metrics = require('@overleaf/metrics')
 
 
 module.exports = {
 module.exports = {
   getUserNotifications(req, res) {
   getUserNotifications(req, res) {

Разница между файлами не показана из-за своего большого размера
+ 350 - 547
services/notifications/package-lock.json


+ 1 - 1
services/notifications/package.json

@@ -17,6 +17,7 @@
   "author": "",
   "author": "",
   "license": "ISC",
   "license": "ISC",
   "dependencies": {
   "dependencies": {
+    "@overleaf/metrics": "^3.4.1",
     "async": "^2.6.3",
     "async": "^2.6.3",
     "body-parser": "^1.19.0",
     "body-parser": "^1.19.0",
     "coffee-script": "^1.12.7",
     "coffee-script": "^1.12.7",
@@ -24,7 +25,6 @@
     "express": "4.17.1",
     "express": "4.17.1",
     "logger-sharelatex": "^2.2.0",
     "logger-sharelatex": "^2.2.0",
     "method-override": "^3.0.0",
     "method-override": "^3.0.0",
-    "metrics-sharelatex": "^2.6.2",
     "mongodb": "^3.6.0",
     "mongodb": "^3.6.0",
     "node-statsd": "0.1.1",
     "node-statsd": "0.1.1",
     "request": "^2.88.2",
     "request": "^2.88.2",

+ 1 - 1
services/notifications/test/unit/js/NotificationsControllerTest.js

@@ -29,7 +29,7 @@ describe('Notifications Controller', function () {
       requires: {
       requires: {
         'logger-sharelatex': { log() {} },
         'logger-sharelatex': { log() {} },
         './Notifications': this.notifications,
         './Notifications': this.notifications,
-        'metrics-sharelatex': {
+        '@overleaf/metrics': {
           inc: sinon.stub()
           inc: sinon.stub()
         }
         }
       }
       }

+ 1 - 1
services/notifications/test/unit/js/NotificationsTests.js

@@ -49,7 +49,7 @@ describe('Notifications Tests', function () {
         },
         },
         'settings-sharelatex': {},
         'settings-sharelatex': {},
         './mongodb': { db: this.db, ObjectId },
         './mongodb': { db: this.db, ObjectId },
-        'metrics-sharelatex': { timeAsyncMethod: sinon.stub() }
+        '@overleaf/metrics': { timeAsyncMethod: sinon.stub() }
       },
       },
       globals: {
       globals: {
         console
         console

Некоторые файлы не были показаны из-за большого количества измененных файлов