mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge branch 'sk-upgrade-metrics'
This commit is contained in:
commit
6a6fdc13a5
4 changed files with 19 additions and 4 deletions
|
@ -9,7 +9,6 @@ Path = require "path"
|
|||
|
||||
Metrics.initialize("docstore")
|
||||
logger.initialize("docstore")
|
||||
Metrics.mongodb.monitor(Path.resolve(__dirname + "/node_modules/mongojs/node_modules/mongodb"), logger)
|
||||
Metrics.event_loop?.monitor(logger)
|
||||
|
||||
app = express()
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{db, ObjectId} = require "./mongojs"
|
||||
logger = require 'logger-sharelatex'
|
||||
metrics = require 'metrics-sharelatex'
|
||||
|
||||
module.exports = MongoManager =
|
||||
|
||||
|
@ -67,4 +69,16 @@ module.exports = MongoManager =
|
|||
$set: version: version
|
||||
}, {
|
||||
upsert: true
|
||||
}, callback
|
||||
}, callback
|
||||
|
||||
|
||||
[
|
||||
'findDoc',
|
||||
'getProjectsDocs',
|
||||
'getArchivedProjectDocs',
|
||||
'upsertIntoDocCollection',
|
||||
'markDocAsArchived',
|
||||
'getDocVersion',
|
||||
'setDocVersion'
|
||||
].map (method) ->
|
||||
metrics.timeAsyncMethod(MongoManager, method, 'mongo.MongoManager', logger)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"dependencies": {
|
||||
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
|
||||
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.4.0",
|
||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.1.0",
|
||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.7.1",
|
||||
"mongojs": "0.18.2",
|
||||
"express": "~4.1.1",
|
||||
"underscore": "~1.6.0",
|
||||
|
|
|
@ -11,6 +11,8 @@ describe "MongoManager", ->
|
|||
"./mongojs":
|
||||
db: @db = { docs: {}, docOps: {} }
|
||||
ObjectId: ObjectId
|
||||
'metrics-sharelatex': {timeAsyncMethod: sinon.stub()}
|
||||
'logger-sharelatex': {log: ()->}
|
||||
@project_id = ObjectId().toString()
|
||||
@doc_id = ObjectId().toString()
|
||||
@callback = sinon.stub()
|
||||
|
@ -151,4 +153,4 @@ describe "MongoManager", ->
|
|||
.should.equal true
|
||||
|
||||
it "should call the callback", ->
|
||||
@callback.called.should.equal true
|
||||
@callback.called.should.equal true
|
||||
|
|
Loading…
Reference in a new issue