From c835528dea5b330d7b689b6bcafc308b93d60985 Mon Sep 17 00:00:00 2001 From: James Allen Date: Fri, 9 May 2014 12:44:13 +0100 Subject: [PATCH] Add in metrics --- services/track-changes/app.coffee | 7 ++++++- services/track-changes/package.json | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/services/track-changes/app.coffee b/services/track-changes/app.coffee index 7489701712..f6b4c0f112 100644 --- a/services/track-changes/app.coffee +++ b/services/track-changes/app.coffee @@ -2,13 +2,18 @@ Settings = require "settings-sharelatex" logger = require "logger-sharelatex" logger.initialize("track-changes") +Path = require "path" +Metrics = require "metrics-sharelatex" +Metrics.initialize("track-changes") +Metrics.mongodb.monitor(Path.resolve(__dirname + "/node_modules/mongojs/node_modules/mongodb"), logger) + require("./app/js/MongoManager").ensureIndices() HttpController = require "./app/js/HttpController" express = require "express" app = express() -app.use express.logger() +app.use Metrics.http.monitor(logger) app.post "/project/:project_id/doc/:doc_id/flush", HttpController.flushDoc diff --git a/services/track-changes/package.json b/services/track-changes/package.json index 0eb4ba9cac..945880b526 100644 --- a/services/track-changes/package.json +++ b/services/track-changes/package.json @@ -7,6 +7,7 @@ "mongojs": "~0.9.11", "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#master", "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#master", + "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#master", "request": "~2.33.0", "redis": "~0.10.1" },