mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-24 02:51:26 +00:00
Merge branch 'sk-upgrade-metrics'
This commit is contained in:
commit
96f5802462
10 changed files with 921 additions and 1273 deletions
|
@ -25,7 +25,6 @@ TrackChangesLogger.addSerializers {
|
|||
Path = require "path"
|
||||
Metrics = require "metrics-sharelatex"
|
||||
Metrics.initialize("track-changes")
|
||||
Metrics.mongodb.monitor(Path.resolve(__dirname + "/node_modules/mongojs/node_modules/mongodb"), logger)
|
||||
Metrics.memory.monitor(logger)
|
||||
|
||||
child_process = require "child_process"
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
module.exports = require "metrics-sharelatex"
|
|
@ -6,7 +6,7 @@ S3S = require 's3-streams'
|
|||
JSONStream = require "JSONStream"
|
||||
ReadlineStream = require "byline"
|
||||
zlib = require "zlib"
|
||||
Metrics = require "./Metrics"
|
||||
Metrics = require "metrics-sharelatex"
|
||||
|
||||
DAYS = 24 * 3600 * 1000 # one day in milliseconds
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
PackManager = require "./PackManager"
|
||||
async = require "async"
|
||||
_ = require "underscore"
|
||||
metrics = require 'metrics-sharelatex'
|
||||
logger = require 'logger-sharelatex'
|
||||
|
||||
module.exports = MongoManager =
|
||||
getLastCompressedUpdate: (doc_id, callback = (error, update) ->) ->
|
||||
|
@ -92,3 +94,11 @@ module.exports = MongoManager =
|
|||
db.docHistory.ensureIndex { last_checked: 1 }, { background: true }
|
||||
# For finding archived packs
|
||||
db.docHistoryIndex.ensureIndex { project_id: 1 }, { background: true }
|
||||
|
||||
|
||||
[
|
||||
'getLastCompressedUpdate',
|
||||
'getProjectMetaData',
|
||||
'setProjectMetaData'
|
||||
].map (method) ->
|
||||
metrics.timeAsyncMethod(MongoManager, method, 'mongo.MongoManager', logger)
|
||||
|
|
|
@ -4,7 +4,7 @@ _ = require "underscore"
|
|||
logger = require "logger-sharelatex"
|
||||
LockManager = require "./LockManager"
|
||||
MongoAWS = require "./MongoAWS"
|
||||
Metrics = require "./Metrics"
|
||||
Metrics = require "metrics-sharelatex"
|
||||
ProjectIterator = require "./ProjectIterator"
|
||||
|
||||
# Sharejs operations are stored in a 'pack' object
|
||||
|
|
2172
services/track-changes/npm-shrinkwrap.json
generated
2172
services/track-changes/npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load diff
|
@ -16,7 +16,7 @@
|
|||
"mongojs": "^1.4.1",
|
||||
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
|
||||
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.5.6",
|
||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.5.0",
|
||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.7.1",
|
||||
"request": "~2.33.0",
|
||||
"requestretry": "^1.12.0",
|
||||
"redis-sharelatex": "~0.0.9",
|
||||
|
|
|
@ -26,6 +26,7 @@ describe "MongoAWS", ->
|
|||
"./mongojs" : { db: @db = {}, ObjectId: ObjectId }
|
||||
"JSONStream": @JSONStream = {}
|
||||
"readline-stream": @readline = sinon.stub()
|
||||
'metrics-sharelatex': {inc: ()->}
|
||||
|
||||
@project_id = ObjectId().toString()
|
||||
@doc_id = ObjectId().toString()
|
||||
|
|
|
@ -14,6 +14,8 @@ describe "MongoManager", ->
|
|||
@MongoManager = SandboxedModule.require modulePath, requires:
|
||||
"./mongojs" : { db: @db = {}, ObjectId: ObjectId }
|
||||
"./PackManager" : @PackManager = {}
|
||||
'metrics-sharelatex': {timeAsyncMethod: ()->}
|
||||
'logger-sharelatex': {log: ()->}
|
||||
@callback = sinon.stub()
|
||||
@doc_id = ObjectId().toString()
|
||||
@project_id = ObjectId().toString()
|
||||
|
|
|
@ -20,6 +20,7 @@ describe "PackManager", ->
|
|||
"./LockManager" : {}
|
||||
"./MongoAWS": {}
|
||||
"logger-sharelatex": { log: sinon.stub(), error: sinon.stub() }
|
||||
'metrics-sharelatex': {inc: ()->}
|
||||
@callback = sinon.stub()
|
||||
@doc_id = ObjectId().toString()
|
||||
@project_id = ObjectId().toString()
|
||||
|
|
Loading…
Reference in a new issue