Merge pull request #200 from overleaf/jpa-bump-metrics-module

[misc] bump metrics module to 3.4.1
This commit is contained in:
Jakob Ackermann 2020-11-26 13:13:50 +00:00 committed by GitHub
commit 8a5858f430
17 changed files with 906 additions and 542 deletions

View file

@ -1,4 +1,4 @@
const Metrics = require('metrics-sharelatex')
const Metrics = require('@overleaf/metrics')
const Settings = require('settings-sharelatex')
Metrics.initialize(Settings.appName || 'real-time')
const async = require('async')

View file

@ -1,5 +1,5 @@
const logger = require('logger-sharelatex')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const settings = require('settings-sharelatex')
const OError = require('@overleaf/o-error')

View file

@ -9,7 +9,7 @@ const EventLogger = require('./EventLogger')
const HealthCheckManager = require('./HealthCheckManager')
const RoomManager = require('./RoomManager')
const ChannelManager = require('./ChannelManager')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
let DocumentUpdaterController
module.exports = DocumentUpdaterController = {

View file

@ -6,7 +6,7 @@ const _ = require('underscore')
const OError = require('@overleaf/o-error')
const logger = require('logger-sharelatex')
const settings = require('settings-sharelatex')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const {
ClientRequestedMissingOpsError,
DocumentUpdaterRequestFailedError,

View file

@ -3,7 +3,7 @@
*/
let EventLogger
const logger = require('logger-sharelatex')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const settings = require('settings-sharelatex')
// keep track of message counters to detect duplicate and out of order events

View file

@ -1,4 +1,4 @@
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const logger = require('logger-sharelatex')
const os = require('os')

View file

@ -2,7 +2,7 @@
camelcase,
*/
const logger = require('logger-sharelatex')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const { EventEmitter } = require('events')
const OError = require('@overleaf/o-error')

View file

@ -1,7 +1,7 @@
/* eslint-disable
camelcase,
*/
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const logger = require('logger-sharelatex')
const settings = require('settings-sharelatex')
const WebsocketController = require('./WebsocketController')

View file

@ -3,7 +3,7 @@
*/
const OError = require('@overleaf/o-error')
const logger = require('logger-sharelatex')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const WebApiManager = require('./WebApiManager')
const AuthorizationManager = require('./AuthorizationManager')
const DocumentUpdaterManager = require('./DocumentUpdaterManager')

File diff suppressed because it is too large Load diff

View file

@ -19,6 +19,7 @@
"format:fix": "node_modules/.bin/prettier-eslint $PWD'/**/*.js' --write"
},
"dependencies": {
"@overleaf/metrics": "^3.4.1",
"@overleaf/o-error": "^3.1.0",
"@overleaf/redis-wrapper": "^2.0.0",
"async": "^0.9.0",
@ -30,7 +31,6 @@
"express": "^4.17.1",
"express-session": "^1.17.1",
"logger-sharelatex": "^2.2.0",
"metrics-sharelatex": "^2.6.2",
"request": "^2.88.2",
"settings-sharelatex": "^1.1.0",
"socket.io": "https://github.com/overleaf/socket.io/archive/0.9.19-overleaf-4.tar.gz",

View file

@ -23,7 +23,7 @@ describe('ChannelManager', function () {
return (this.ChannelManager = SandboxedModule.require(modulePath, {
requires: {
'settings-sharelatex': (this.settings = {}),
'metrics-sharelatex': (this.metrics = {
'@overleaf/metrics': (this.metrics = {
inc: sinon.stub(),
summary: sinon.stub()
}),

View file

@ -58,7 +58,7 @@ describe('DocumentUpdaterController', function () {
}),
'./EventLogger': (this.EventLogger = { checkEventOrder: sinon.stub() }),
'./HealthCheckManager': { check: sinon.stub() },
'metrics-sharelatex': (this.metrics = { inc: sinon.stub() }),
'@overleaf/metrics': (this.metrics = { inc: sinon.stub() }),
'./RoomManager': (this.RoomManager = {
eventSource: sinon.stub().returns(this.RoomEvents)
}),

View file

@ -48,7 +48,7 @@ describe('DocumentUpdaterManager', function () {
}),
request: (this.request = {}),
'@overleaf/redis-wrapper': { createClient: () => this.rclient },
'metrics-sharelatex': (this.Metrics = {
'@overleaf/metrics': (this.Metrics = {
summary: sinon.stub(),
Timer: (Timer = class Timer {
done() {}

View file

@ -25,7 +25,7 @@ describe('EventLogger', function () {
error: sinon.stub(),
warn: sinon.stub()
}),
'metrics-sharelatex': (this.metrics = { inc: sinon.stub() })
'@overleaf/metrics': (this.metrics = { inc: sinon.stub() })
}
})
this.channel = 'applied-ops'

View file

@ -31,7 +31,7 @@ describe('RoomManager', function () {
warn: sinon.stub(),
error: sinon.stub()
}),
'metrics-sharelatex': (this.metrics = { gauge: sinon.stub() })
'@overleaf/metrics': (this.metrics = { gauge: sinon.stub() })
}
})
this.RoomManager._clientsInRoom = sinon.stub()

View file

@ -55,7 +55,7 @@ describe('WebsocketController', function () {
error: sinon.stub(),
warn: sinon.stub()
}),
'metrics-sharelatex': (this.metrics = {
'@overleaf/metrics': (this.metrics = {
inc: sinon.stub(),
set: sinon.stub()
}),