mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #73 from overleaf/spd-metrics-upgrade
Upgrade metrics to @overleaf/metrics'
This commit is contained in:
commit
1b73733625
7 changed files with 61 additions and 56 deletions
|
@ -4,7 +4,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('docstore')
|
Metrics.initialize('docstore')
|
||||||
const Settings = require('settings-sharelatex')
|
const Settings = require('settings-sharelatex')
|
||||||
const logger = require('logger-sharelatex')
|
const logger = require('logger-sharelatex')
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
let MongoManager
|
let MongoManager
|
||||||
const { getCollection, ObjectId } = require('./mongodb')
|
const { getCollection, ObjectId } = require('./mongodb')
|
||||||
const logger = require('logger-sharelatex')
|
const logger = require('logger-sharelatex')
|
||||||
const metrics = require('metrics-sharelatex')
|
const metrics = require('@overleaf/metrics')
|
||||||
const { promisify } = require('util')
|
const { promisify } = require('util')
|
||||||
|
|
||||||
const docsCollectionPromise = getCollection('docs')
|
const docsCollectionPromise = getCollection('docs')
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const settings = require('settings-sharelatex')
|
const settings = require('settings-sharelatex')
|
||||||
|
|
||||||
const persistorSettings = settings.docstore
|
const persistorSettings = settings.docstore
|
||||||
persistorSettings.Metrics = require('metrics-sharelatex')
|
persistorSettings.Metrics = require('@overleaf/metrics')
|
||||||
|
|
||||||
const ObjectPersistor = require('@overleaf/object-persistor')
|
const ObjectPersistor = require('@overleaf/object-persistor')
|
||||||
const persistor = ObjectPersistor(persistorSettings)
|
const persistor = ObjectPersistor(persistorSettings)
|
||||||
|
|
103
services/docstore/package-lock.json
generated
103
services/docstore/package-lock.json
generated
|
@ -1044,6 +1044,32 @@
|
||||||
"uuid": "^3.2.1"
|
"uuid": "^3.2.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@overleaf/metrics": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@overleaf/metrics/-/metrics-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-YUtB2P6LZbk+FRXnmTX8mdiq13IJ98FvZxIKyZp77cmlF9MCAUrtf+nvatC1l5Zce8/RThU9KQBM0p0Na+Ww7g==",
|
||||||
|
"requires": {
|
||||||
|
"@google-cloud/debug-agent": "^3.0.0",
|
||||||
|
"@google-cloud/profiler": "^0.2.3",
|
||||||
|
"@google-cloud/trace-agent": "^3.2.0",
|
||||||
|
"compression": "^1.7.4",
|
||||||
|
"prom-client": "^11.1.3",
|
||||||
|
"underscore": "~1.6.0",
|
||||||
|
"yn": "^3.1.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"underscore": {
|
||||||
|
"version": "1.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz",
|
||||||
|
"integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag="
|
||||||
|
},
|
||||||
|
"yn": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@overleaf/o-error": {
|
"@overleaf/o-error": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@overleaf/o-error/-/o-error-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@overleaf/o-error/-/o-error-3.0.0.tgz",
|
||||||
|
@ -1934,11 +1960,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"coffee-script": {
|
|
||||||
"version": "1.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.6.0.tgz",
|
|
||||||
"integrity": "sha512-Tx8itEfCsQp8RbLDFt7qwjqXycAx2g6SI7//4PPUR2j6meLmNifYm6zKrNDcU1+Q/GWRhjhEZk7DaLG1TfIzGA=="
|
|
||||||
},
|
|
||||||
"color-convert": {
|
"color-convert": {
|
||||||
"version": "1.9.3",
|
"version": "1.9.3",
|
||||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||||
|
@ -1983,6 +2004,27 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"compression": {
|
||||||
|
"version": "1.7.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz",
|
||||||
|
"integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==",
|
||||||
|
"requires": {
|
||||||
|
"accepts": "~1.3.5",
|
||||||
|
"bytes": "3.0.0",
|
||||||
|
"compressible": "~2.0.16",
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"on-headers": "~1.0.2",
|
||||||
|
"safe-buffer": "5.1.2",
|
||||||
|
"vary": "~1.1.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"bytes": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
|
@ -4193,15 +4235,6 @@
|
||||||
"yallist": "^3.0.2"
|
"yallist": "^3.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lynx": {
|
|
||||||
"version": "0.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/lynx/-/lynx-0.1.1.tgz",
|
|
||||||
"integrity": "sha512-JI52N0NwK2b/Md0TFPdPtUBI46kjyJXF7+q08l2yvQ56q6QA8s7ZjZQQRoxFpS2jDXNf/B0p8ID+OIKcTsZwzw==",
|
|
||||||
"requires": {
|
|
||||||
"mersenne": "~0.0.3",
|
|
||||||
"statsd-parser": "~0.0.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"make-plural": {
|
"make-plural": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/make-plural/-/make-plural-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/make-plural/-/make-plural-4.3.0.tgz",
|
||||||
|
@ -4258,11 +4291,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
||||||
"integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
|
"integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
|
||||||
},
|
},
|
||||||
"mersenne": {
|
|
||||||
"version": "0.0.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/mersenne/-/mersenne-0.0.4.tgz",
|
|
||||||
"integrity": "sha512-XoSUL+nF8hMTKGQxUs8r3Btdsf1yuKKBdCCGbh3YXgCXuVKishpZv1CNc385w9s8t4Ynwc5h61BwW/FCVulkbg=="
|
|
||||||
},
|
|
||||||
"messageformat": {
|
"messageformat": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/messageformat/-/messageformat-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/messageformat/-/messageformat-2.3.0.tgz",
|
||||||
|
@ -4291,33 +4319,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||||
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w=="
|
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w=="
|
||||||
},
|
},
|
||||||
"metrics-sharelatex": {
|
|
||||||
"version": "2.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/metrics-sharelatex/-/metrics-sharelatex-2.7.0.tgz",
|
|
||||||
"integrity": "sha512-fv7TsM2pVhY/VuHqP5p9Ip2BhHfGPrP0e2TuZGCMK9/J83ZuGCrxkpaU3OOz31CWcmcQ5am4Du70EZAaIdA/2A==",
|
|
||||||
"requires": {
|
|
||||||
"@google-cloud/debug-agent": "^3.0.0",
|
|
||||||
"@google-cloud/profiler": "^0.2.3",
|
|
||||||
"@google-cloud/trace-agent": "^3.2.0",
|
|
||||||
"coffee-script": "1.6.0",
|
|
||||||
"lynx": "~0.1.1",
|
|
||||||
"prom-client": "^11.1.3",
|
|
||||||
"underscore": "~1.6.0",
|
|
||||||
"yn": "^3.1.1"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"underscore": {
|
|
||||||
"version": "1.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz",
|
|
||||||
"integrity": "sha512-z4o1fvKUojIWh9XuaVLUDdf86RQiq13AC1dmHbTpoyuu+bquHms76v16CjycCbec87J7z0k//SiQVk0sMdFmpQ=="
|
|
||||||
},
|
|
||||||
"yn": {
|
|
||||||
"version": "3.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
|
||||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mime": {
|
"mime": {
|
||||||
"version": "2.4.4",
|
"version": "2.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz",
|
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz",
|
||||||
|
@ -4767,6 +4768,11 @@
|
||||||
"ee-first": "1.1.1"
|
"ee-first": "1.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"on-headers": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA=="
|
||||||
|
},
|
||||||
"once": {
|
"once": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
|
@ -6353,11 +6359,6 @@
|
||||||
"integrity": "sha512-vjUc6sfgtgY0dxCdnc40mK6Oftjo9+2K8H/NG81TMhgL392FtiPA9tn9RLyTxXmTLPJPjF3VyzFp6bsWFLisMQ==",
|
"integrity": "sha512-vjUc6sfgtgY0dxCdnc40mK6Oftjo9+2K8H/NG81TMhgL392FtiPA9tn9RLyTxXmTLPJPjF3VyzFp6bsWFLisMQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"statsd-parser": {
|
|
||||||
"version": "0.0.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/statsd-parser/-/statsd-parser-0.0.4.tgz",
|
|
||||||
"integrity": "sha512-7XO+ur89EalMXXFQaydsczB8sclr5nDsNIoUu0IzJx1pIbHUhO3LtpSzBwetIuU9DyTLMiVaJBMtWS/Nb2KR4g=="
|
|
||||||
},
|
|
||||||
"statuses": {
|
"statuses": {
|
||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
|
||||||
|
|
|
@ -19,12 +19,12 @@
|
||||||
"format:fix": "node_modules/.bin/prettier-eslint $PWD'/**/*.js' --write"
|
"format:fix": "node_modules/.bin/prettier-eslint $PWD'/**/*.js' --write"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@overleaf/metrics": "^3.1.0",
|
||||||
"@overleaf/object-persistor": "git+https://github.com/overleaf/object-persistor.git",
|
"@overleaf/object-persistor": "git+https://github.com/overleaf/object-persistor.git",
|
||||||
"async": "^2.6.3",
|
"async": "^2.6.3",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"logger-sharelatex": "^2.2.0",
|
"logger-sharelatex": "^2.2.0",
|
||||||
"metrics-sharelatex": "^2.7.0",
|
|
||||||
"mongodb": "^3.6.0",
|
"mongodb": "^3.6.0",
|
||||||
"settings-sharelatex": "^1.1.0",
|
"settings-sharelatex": "^1.1.0",
|
||||||
"streamifier": "^0.1.1",
|
"streamifier": "^0.1.1",
|
||||||
|
|
|
@ -23,6 +23,9 @@ const { ObjectId } = require('mongodb')
|
||||||
|
|
||||||
describe('HttpController', function () {
|
describe('HttpController', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
const settings = {
|
||||||
|
max_doc_length: 2 * 1024 * 1024
|
||||||
|
}
|
||||||
this.HttpController = SandboxedModule.require(modulePath, {
|
this.HttpController = SandboxedModule.require(modulePath, {
|
||||||
requires: {
|
requires: {
|
||||||
'./DocManager': (this.DocManager = {}),
|
'./DocManager': (this.DocManager = {}),
|
||||||
|
@ -31,6 +34,7 @@ describe('HttpController', function () {
|
||||||
log: sinon.stub(),
|
log: sinon.stub(),
|
||||||
error: sinon.stub()
|
error: sinon.stub()
|
||||||
}),
|
}),
|
||||||
|
'settings-sharelatex': settings,
|
||||||
'./HealthChecker': {}
|
'./HealthChecker': {}
|
||||||
},
|
},
|
||||||
globals: { process }
|
globals: { process }
|
||||||
|
|
|
@ -31,7 +31,7 @@ describe('MongoManager', function () {
|
||||||
db: (this.db = { docs: {}, docOps: {} }),
|
db: (this.db = { docs: {}, docOps: {} }),
|
||||||
ObjectId
|
ObjectId
|
||||||
},
|
},
|
||||||
'metrics-sharelatex': { timeAsyncMethod: sinon.stub() },
|
'@overleaf/metrics': { timeAsyncMethod: sinon.stub() },
|
||||||
'logger-sharelatex': { log() {} }
|
'logger-sharelatex': { log() {} }
|
||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
|
|
Loading…
Reference in a new issue