diff --git a/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee b/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee index 3c43323887..70cd0a845b 100644 --- a/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee +++ b/services/web/app/coffee/Features/Authentication/AuthenticationController.coffee @@ -2,7 +2,7 @@ AuthenticationManager = require ("./AuthenticationManager") LoginRateLimiter = require("../Security/LoginRateLimiter") UserGetter = require "../User/UserGetter" UserUpdater = require "../User/UserUpdater" -Metrics = require('../../infrastructure/Metrics') +Metrics = require('metrics-sharelatex') logger = require("logger-sharelatex") querystring = require('querystring') Url = require("url") diff --git a/services/web/app/coffee/Features/BetaProgram/BetaProgramHandler.coffee b/services/web/app/coffee/Features/BetaProgram/BetaProgramHandler.coffee index 788782d578..0c902fcfe1 100644 --- a/services/web/app/coffee/Features/BetaProgram/BetaProgramHandler.coffee +++ b/services/web/app/coffee/Features/BetaProgram/BetaProgramHandler.coffee @@ -1,6 +1,6 @@ User = require("../../models/User").User logger = require 'logger-sharelatex' -metrics = require("../../infrastructure/Metrics") +metrics = require("metrics-sharelatex") module.exports = BetaProgramHandler = diff --git a/services/web/app/coffee/Features/Compile/CompileController.coffee b/services/web/app/coffee/Features/Compile/CompileController.coffee index 4a23431574..27ee604ba5 100755 --- a/services/web/app/coffee/Features/Compile/CompileController.coffee +++ b/services/web/app/coffee/Features/Compile/CompileController.coffee @@ -1,4 +1,4 @@ -Metrics = require "../../infrastructure/Metrics" +Metrics = require "metrics-sharelatex" Project = require("../../models/Project").Project CompileManager = require("./CompileManager") ClsiManager = require("./ClsiManager") diff --git a/services/web/app/coffee/Features/Compile/CompileManager.coffee b/services/web/app/coffee/Features/Compile/CompileManager.coffee index 24a051f9f3..3bfbf8df7d 100755 --- a/services/web/app/coffee/Features/Compile/CompileManager.coffee +++ b/services/web/app/coffee/Features/Compile/CompileManager.coffee @@ -6,7 +6,7 @@ Project = require("../../models/Project").Project ProjectRootDocManager = require "../Project/ProjectRootDocManager" UserGetter = require "../User/UserGetter" ClsiManager = require "./ClsiManager" -Metrics = require('../../infrastructure/Metrics') +Metrics = require('metrics-sharelatex') logger = require("logger-sharelatex") rateLimiter = require("../../infrastructure/RateLimiter") diff --git a/services/web/app/coffee/Features/DocumentUpdater/DocumentUpdaterHandler.coffee b/services/web/app/coffee/Features/DocumentUpdater/DocumentUpdaterHandler.coffee index 5c15735410..595fe07971 100644 --- a/services/web/app/coffee/Features/DocumentUpdater/DocumentUpdaterHandler.coffee +++ b/services/web/app/coffee/Features/DocumentUpdater/DocumentUpdaterHandler.coffee @@ -4,7 +4,7 @@ settings = require 'settings-sharelatex' _ = require 'underscore' async = require 'async' logger = require('logger-sharelatex') -metrics = require('../../infrastructure/Metrics') +metrics = require('metrics-sharelatex') redis = require("redis-sharelatex") rclient = redis.createClient(settings.redis.web) Project = require("../../models/Project").Project diff --git a/services/web/app/coffee/Features/Downloads/ProjectDownloadsController.coffee b/services/web/app/coffee/Features/Downloads/ProjectDownloadsController.coffee index 22272600c9..b488472149 100644 --- a/services/web/app/coffee/Features/Downloads/ProjectDownloadsController.coffee +++ b/services/web/app/coffee/Features/Downloads/ProjectDownloadsController.coffee @@ -1,5 +1,5 @@ logger = require "logger-sharelatex" -Metrics = require "../../infrastructure/Metrics" +Metrics = require "metrics-sharelatex" Project = require("../../models/Project").Project ProjectZipStreamManager = require "./ProjectZipStreamManager" DocumentUpdaterHandler = require "../DocumentUpdater/DocumentUpdaterHandler" diff --git a/services/web/app/coffee/Features/Editor/EditorController.coffee b/services/web/app/coffee/Features/Editor/EditorController.coffee index b5abab3bf9..a90ab5504a 100644 --- a/services/web/app/coffee/Features/Editor/EditorController.coffee +++ b/services/web/app/coffee/Features/Editor/EditorController.coffee @@ -1,5 +1,5 @@ logger = require('logger-sharelatex') -Metrics = require('../../infrastructure/Metrics') +Metrics = require('metrics-sharelatex') sanitize = require('sanitizer') ProjectEntityHandler = require('../Project/ProjectEntityHandler') ProjectOptionsHandler = require('../Project/ProjectOptionsHandler') diff --git a/services/web/app/coffee/Features/Editor/EditorHttpController.coffee b/services/web/app/coffee/Features/Editor/EditorHttpController.coffee index 0c547e53ba..2e6d9e5c84 100644 --- a/services/web/app/coffee/Features/Editor/EditorHttpController.coffee +++ b/services/web/app/coffee/Features/Editor/EditorHttpController.coffee @@ -7,7 +7,7 @@ ProjectGetter = require('../Project/ProjectGetter') UserGetter = require('../User/UserGetter') AuthorizationManager = require("../Authorization/AuthorizationManager") ProjectEditorHandler = require('../Project/ProjectEditorHandler') -Metrics = require('../../infrastructure/Metrics') +Metrics = require('metrics-sharelatex') CollaboratorsHandler = require("../Collaborators/CollaboratorsHandler") CollaboratorsInviteHandler = require("../Collaborators/CollaboratorsInviteHandler") PrivilegeLevels = require "../Authorization/PrivilegeLevels" diff --git a/services/web/app/coffee/Features/Email/EmailSender.coffee b/services/web/app/coffee/Features/Email/EmailSender.coffee index 04b4d39132..10dccfe53a 100644 --- a/services/web/app/coffee/Features/Email/EmailSender.coffee +++ b/services/web/app/coffee/Features/Email/EmailSender.coffee @@ -1,5 +1,5 @@ logger = require('logger-sharelatex') -metrics = require('../../infrastructure/Metrics') +metrics = require('metrics-sharelatex') Settings = require('settings-sharelatex') nodemailer = require("nodemailer") sesTransport = require('nodemailer-ses-transport') diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index ce9bfbd727..f967a98ffb 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -4,7 +4,7 @@ projectDeleter = require("./ProjectDeleter") projectDuplicator = require("./ProjectDuplicator") projectCreationHandler = require("./ProjectCreationHandler") editorController = require("../Editor/EditorController") -metrics = require('../../infrastructure/Metrics') +metrics = require('metrics-sharelatex') User = require('../../models/User').User TagsHandler = require("../Tags/TagsHandler") SubscriptionLocator = require("../Subscription/SubscriptionLocator") diff --git a/services/web/app/coffee/Features/Project/ProjectCreationHandler.coffee b/services/web/app/coffee/Features/Project/ProjectCreationHandler.coffee index 8095a54df8..ffb69abeac 100644 --- a/services/web/app/coffee/Features/Project/ProjectCreationHandler.coffee +++ b/services/web/app/coffee/Features/Project/ProjectCreationHandler.coffee @@ -1,6 +1,6 @@ logger = require('logger-sharelatex') async = require("async") -metrics = require('../../infrastructure/Metrics') +metrics = require('metrics-sharelatex') Settings = require('settings-sharelatex') ObjectId = require('mongoose').Types.ObjectId Project = require('../../models/Project').Project diff --git a/services/web/app/coffee/Features/Project/ProjectGetter.coffee b/services/web/app/coffee/Features/Project/ProjectGetter.coffee index 6d3e17536f..ac2ce53ac2 100644 --- a/services/web/app/coffee/Features/Project/ProjectGetter.coffee +++ b/services/web/app/coffee/Features/Project/ProjectGetter.coffee @@ -1,5 +1,5 @@ mongojs = require("../../infrastructure/mongojs") -metrics = require("../../infrastructure/Metrics") +metrics = require("metrics-sharelatex") db = mongojs.db ObjectId = mongojs.ObjectId async = require "async" diff --git a/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsController.coffee b/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsController.coffee index 6801c6b0b3..eed57ec3f7 100644 --- a/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsController.coffee +++ b/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsController.coffee @@ -2,7 +2,7 @@ tpdsUpdateHandler = require('./TpdsUpdateHandler') UpdateMerger = require "./UpdateMerger" logger = require('logger-sharelatex') Path = require('path') -metrics = require("../../infrastructure/Metrics") +metrics = require("metrics-sharelatex") module.exports = # mergeUpdate and deleteUpdate are used by Dropbox, where the project is only passed as the name, as the diff --git a/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsUpdateSender.coffee b/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsUpdateSender.coffee index 2f3b7fb9a8..852c50fe21 100644 --- a/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsUpdateSender.coffee +++ b/services/web/app/coffee/Features/ThirdPartyDataStore/TpdsUpdateSender.coffee @@ -3,7 +3,7 @@ logger = require('logger-sharelatex') path = require('path') Project = require('../../models/Project').Project keys = require('../../infrastructure/Keys') -metrics = require("../../infrastructure/Metrics") +metrics = require("metrics-sharelatex") request = require("request") CollaboratorsHandler = require('../Collaborators/CollaboratorsHandler') diff --git a/services/web/app/coffee/Features/Uploads/ArchiveManager.coffee b/services/web/app/coffee/Features/Uploads/ArchiveManager.coffee index 645828ca6d..607186e1bb 100644 --- a/services/web/app/coffee/Features/Uploads/ArchiveManager.coffee +++ b/services/web/app/coffee/Features/Uploads/ArchiveManager.coffee @@ -1,6 +1,6 @@ child = require "child_process" logger = require "logger-sharelatex" -metrics = require "../../infrastructure/Metrics" +metrics = require "metrics-sharelatex" fs = require "fs" Path = require "path" _ = require("underscore") diff --git a/services/web/app/coffee/Features/Uploads/ProjectUploadController.coffee b/services/web/app/coffee/Features/Uploads/ProjectUploadController.coffee index de23c45015..8e4464828f 100644 --- a/services/web/app/coffee/Features/Uploads/ProjectUploadController.coffee +++ b/services/web/app/coffee/Features/Uploads/ProjectUploadController.coffee @@ -1,5 +1,5 @@ logger = require "logger-sharelatex" -metrics = require "../../infrastructure/Metrics" +metrics = require "metrics-sharelatex" fs = require "fs" Path = require "path" FileSystemImportManager = require "./FileSystemImportManager" diff --git a/services/web/app/coffee/Features/User/UserController.coffee b/services/web/app/coffee/Features/User/UserController.coffee index 639e565d27..50b02fc918 100644 --- a/services/web/app/coffee/Features/User/UserController.coffee +++ b/services/web/app/coffee/Features/User/UserController.coffee @@ -5,7 +5,7 @@ User = require("../../models/User").User newsLetterManager = require('../Newsletter/NewsletterManager') UserRegistrationHandler = require("./UserRegistrationHandler") logger = require("logger-sharelatex") -metrics = require("../../infrastructure/Metrics") +metrics = require("metrics-sharelatex") Url = require("url") AuthenticationManager = require("../Authentication/AuthenticationManager") AuthenticationController = require('../Authentication/AuthenticationController') diff --git a/services/web/app/coffee/Features/User/UserCreator.coffee b/services/web/app/coffee/Features/User/UserCreator.coffee index 0e54452684..d4ce82cafb 100644 --- a/services/web/app/coffee/Features/User/UserCreator.coffee +++ b/services/web/app/coffee/Features/User/UserCreator.coffee @@ -1,7 +1,7 @@ User = require("../../models/User").User UserLocator = require("./UserLocator") logger = require("logger-sharelatex") -metrics = require('../../infrastructure/Metrics') +metrics = require('metrics-sharelatex') module.exports = UserCreator = diff --git a/services/web/app/coffee/Features/User/UserGetter.coffee b/services/web/app/coffee/Features/User/UserGetter.coffee index 430033cb3c..1f6e5b594e 100644 --- a/services/web/app/coffee/Features/User/UserGetter.coffee +++ b/services/web/app/coffee/Features/User/UserGetter.coffee @@ -1,5 +1,5 @@ mongojs = require("../../infrastructure/mongojs") -metrics = require('../../infrastructure/Metrics') +metrics = require('metrics-sharelatex') logger = require('logger-sharelatex') db = mongojs.db ObjectId = mongojs.ObjectId diff --git a/services/web/app/coffee/Features/User/UserLocator.coffee b/services/web/app/coffee/Features/User/UserLocator.coffee index 9166392c44..9be32c76b0 100644 --- a/services/web/app/coffee/Features/User/UserLocator.coffee +++ b/services/web/app/coffee/Features/User/UserLocator.coffee @@ -1,5 +1,5 @@ mongojs = require("../../infrastructure/mongojs") -metrics = require("../../infrastructure/Metrics") +metrics = require("metrics-sharelatex") db = mongojs.db ObjectId = mongojs.ObjectId logger = require('logger-sharelatex') diff --git a/services/web/app/coffee/Features/User/UserUpdater.coffee b/services/web/app/coffee/Features/User/UserUpdater.coffee index fd92bed077..530d81063d 100644 --- a/services/web/app/coffee/Features/User/UserUpdater.coffee +++ b/services/web/app/coffee/Features/User/UserUpdater.coffee @@ -1,6 +1,6 @@ logger = require("logger-sharelatex") mongojs = require("../../infrastructure/mongojs") -metrics = require("../../infrastructure/Metrics") +metrics = require("metrics-sharelatex") db = mongojs.db ObjectId = mongojs.ObjectId UserLocator = require("./UserLocator") diff --git a/services/web/app/coffee/infrastructure/CrawlerLogger.coffee b/services/web/app/coffee/infrastructure/CrawlerLogger.coffee index e6900ec994..4b3a2cd702 100644 --- a/services/web/app/coffee/infrastructure/CrawlerLogger.coffee +++ b/services/web/app/coffee/infrastructure/CrawlerLogger.coffee @@ -1,4 +1,4 @@ -metrics = require('./Metrics') +metrics = require('metrics-sharelatex') module.exports = log: (req)-> if req.headers["user-agent"]? diff --git a/services/web/app/coffee/infrastructure/LockManager.coffee b/services/web/app/coffee/infrastructure/LockManager.coffee index 32ae2af765..3e40f9d9dc 100644 --- a/services/web/app/coffee/infrastructure/LockManager.coffee +++ b/services/web/app/coffee/infrastructure/LockManager.coffee @@ -1,4 +1,4 @@ -metrics = require('./Metrics') +metrics = require('metrics-sharelatex') Settings = require('settings-sharelatex') redis = require("redis-sharelatex") rclient = redis.createClient(Settings.redis.web) diff --git a/services/web/app/coffee/infrastructure/Metrics.coffee b/services/web/app/coffee/infrastructure/Metrics.coffee deleted file mode 100644 index 4558ec12a8..0000000000 --- a/services/web/app/coffee/infrastructure/Metrics.coffee +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("metrics-sharelatex") \ No newline at end of file diff --git a/services/web/app/coffee/infrastructure/RandomLogging.coffee b/services/web/app/coffee/infrastructure/RandomLogging.coffee index c73463ea62..6657fb3aae 100644 --- a/services/web/app/coffee/infrastructure/RandomLogging.coffee +++ b/services/web/app/coffee/infrastructure/RandomLogging.coffee @@ -1,5 +1,5 @@ _ = require('underscore') -metrics = require('./Metrics') +metrics = require('metrics-sharelatex') do trackOpenSockets = -> metrics.gauge("http.open-sockets", _.size(require('http').globalAgent.sockets.length), 0.5) diff --git a/services/web/app/coffee/infrastructure/Server.coffee b/services/web/app/coffee/infrastructure/Server.coffee index 245eef6ae4..b9ef1b7b31 100644 --- a/services/web/app/coffee/infrastructure/Server.coffee +++ b/services/web/app/coffee/infrastructure/Server.coffee @@ -2,7 +2,7 @@ Path = require "path" express = require('express') Settings = require('settings-sharelatex') logger = require 'logger-sharelatex' -metrics = require('./Metrics') +metrics = require('metrics-sharelatex') crawlerLogger = require('./CrawlerLogger') expressLocals = require('./ExpressLocals') Router = require('../router') diff --git a/services/web/app/coffee/router.coffee b/services/web/app/coffee/router.coffee index 53e92eb7a6..860b7809ed 100644 --- a/services/web/app/coffee/router.coffee +++ b/services/web/app/coffee/router.coffee @@ -9,7 +9,7 @@ Settings = require('settings-sharelatex') TpdsController = require('./Features/ThirdPartyDataStore/TpdsController') SubscriptionRouter = require './Features/Subscription/SubscriptionRouter' UploadsRouter = require './Features/Uploads/UploadsRouter' -metrics = require('./infrastructure/Metrics') +metrics = require('metrics-sharelatex') ReferalController = require('./Features/Referal/ReferalController') AuthenticationController = require('./Features/Authentication/AuthenticationController') TagsController = require("./Features/Tags/TagsController") diff --git a/services/web/test/UnitTests/coffee/Authentication/AuthenticationControllerTests.coffee b/services/web/test/UnitTests/coffee/Authentication/AuthenticationControllerTests.coffee index f44968a0e5..f99e8543b1 100644 --- a/services/web/test/UnitTests/coffee/Authentication/AuthenticationControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Authentication/AuthenticationControllerTests.coffee @@ -16,7 +16,7 @@ describe "AuthenticationController", -> "./AuthenticationManager": @AuthenticationManager = {} "../User/UserGetter" : @UserGetter = {} "../User/UserUpdater" : @UserUpdater = {} - "../../infrastructure/Metrics": @Metrics = { inc: sinon.stub() } + "metrics-sharelatex": @Metrics = { inc: sinon.stub() } "../Security/LoginRateLimiter": @LoginRateLimiter = { processLoginRequest:sinon.stub(), recordSuccessfulLogin:sinon.stub() } "../User/UserHandler": @UserHandler = {setupLoginData:sinon.stub()} "../Analytics/AnalyticsManager": @AnalyticsManager = { recordEvent: sinon.stub() } diff --git a/services/web/test/UnitTests/coffee/BetaProgram/BetaProgramHandlerTests.coffee b/services/web/test/UnitTests/coffee/BetaProgram/BetaProgramHandlerTests.coffee index affa9f38a5..2a1a1b1629 100644 --- a/services/web/test/UnitTests/coffee/BetaProgram/BetaProgramHandlerTests.coffee +++ b/services/web/test/UnitTests/coffee/BetaProgram/BetaProgramHandlerTests.coffee @@ -26,7 +26,7 @@ describe 'BetaProgramHandler', -> log: sinon.stub() err: sinon.stub() }, - "../../infrastructure/Metrics": @logger = { + "metrics-sharelatex": @logger = { inc: sinon.stub() } diff --git a/services/web/test/UnitTests/coffee/Compile/CompileControllerTests.coffee b/services/web/test/UnitTests/coffee/Compile/CompileControllerTests.coffee index 9874b77265..53c713ac42 100644 --- a/services/web/test/UnitTests/coffee/Compile/CompileControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Compile/CompileControllerTests.coffee @@ -42,7 +42,7 @@ describe "CompileController", -> "request": @request = sinon.stub() "../../models/Project": Project: @Project = {} "logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub() } - "../../infrastructure/Metrics": @Metrics = { inc: sinon.stub() } + "metrics-sharelatex": @Metrics = { inc: sinon.stub() } "./CompileManager":@CompileManager "../User/UserGetter":@UserGetter "./ClsiManager": @ClsiManager diff --git a/services/web/test/UnitTests/coffee/Compile/CompileManagerTests.coffee b/services/web/test/UnitTests/coffee/Compile/CompileManagerTests.coffee index 849e9e8ccc..de56443707 100644 --- a/services/web/test/UnitTests/coffee/Compile/CompileManagerTests.coffee +++ b/services/web/test/UnitTests/coffee/Compile/CompileManagerTests.coffee @@ -23,7 +23,7 @@ describe "CompileManager", -> "../User/UserGetter": @UserGetter = {} "./ClsiManager": @ClsiManager = {} "../../infrastructure/RateLimiter": @ratelimiter - "../../infrastructure/Metrics": @Metrics = + "metrics-sharelatex": @Metrics = Timer: class Timer done: sinon.stub() inc: sinon.stub() diff --git a/services/web/test/UnitTests/coffee/DocumentUpdater/DocumentUpdaterHandlerTests.coffee b/services/web/test/UnitTests/coffee/DocumentUpdater/DocumentUpdaterHandlerTests.coffee index 681915abc6..f5519ffa68 100644 --- a/services/web/test/UnitTests/coffee/DocumentUpdater/DocumentUpdaterHandlerTests.coffee +++ b/services/web/test/UnitTests/coffee/DocumentUpdater/DocumentUpdaterHandlerTests.coffee @@ -32,7 +32,7 @@ describe 'DocumentUpdaterHandler', -> "../../models/Project": Project: @Project={} '../../Features/Project/ProjectLocator':{} 'redis-sharelatex' : createClient: () => @rclient - "../../infrastructure/Metrics": + "metrics-sharelatex": Timer:-> done:-> diff --git a/services/web/test/UnitTests/coffee/Downloads/ProjectDownloadsControllerTests.coffee b/services/web/test/UnitTests/coffee/Downloads/ProjectDownloadsControllerTests.coffee index 135ff8bfa8..7fd0b81ec8 100644 --- a/services/web/test/UnitTests/coffee/Downloads/ProjectDownloadsControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Downloads/ProjectDownloadsControllerTests.coffee @@ -17,7 +17,7 @@ describe "ProjectDownloadsController", -> @ProjectDownloadsController = SandboxedModule.require modulePath, requires: "./ProjectZipStreamManager" : @ProjectZipStreamManager = {} "../../models/Project" : Project: @Project = {} - "../../infrastructure/Metrics": @metrics = {} + "metrics-sharelatex": @metrics = {} "logger-sharelatex" : @logger = {log: sinon.stub()} "../DocumentUpdater/DocumentUpdaterHandler": @DocumentUpdaterHandler diff --git a/services/web/test/UnitTests/coffee/Editor/EditorControllerTests.coffee b/services/web/test/UnitTests/coffee/Editor/EditorControllerTests.coffee index fd56fbb021..72285a1f44 100644 --- a/services/web/test/UnitTests/coffee/Editor/EditorControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Editor/EditorControllerTests.coffee @@ -64,7 +64,7 @@ describe "EditorController", -> "settings-sharelatex":@settings '../Dropbox/DropboxProjectLinker':@dropboxProjectLinker './EditorRealTimeController':@EditorRealTimeController = {} - "../../infrastructure/Metrics": @Metrics = { inc: sinon.stub() } + "metrics-sharelatex": @Metrics = { inc: sinon.stub() } "../TrackChanges/TrackChangesManager": @TrackChangesManager = {} "../../infrastructure/LockManager":@LockManager 'redis-sharelatex':createClient:-> auth:-> diff --git a/services/web/test/UnitTests/coffee/Editor/EditorHttpControllerTests.coffee b/services/web/test/UnitTests/coffee/Editor/EditorHttpControllerTests.coffee index 3134cea34b..76079e07ab 100644 --- a/services/web/test/UnitTests/coffee/Editor/EditorHttpControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Editor/EditorHttpControllerTests.coffee @@ -15,7 +15,7 @@ describe "EditorHttpController", -> "./EditorRealTimeController": @EditorRealTimeController = {} "logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub() } "./EditorController": @EditorController = {} - '../../infrastructure/Metrics': @Metrics = {inc: sinon.stub()} + 'metrics-sharelatex': @Metrics = {inc: sinon.stub()} "../Collaborators/CollaboratorsHandler": @CollaboratorsHandler = {} "../Collaborators/CollaboratorsInviteHandler": @CollaboratorsInviteHandler = {} diff --git a/services/web/test/UnitTests/coffee/Email/EmailSenderTests.coffee b/services/web/test/UnitTests/coffee/Email/EmailSenderTests.coffee index dc504907bf..84efd2c0ca 100644 --- a/services/web/test/UnitTests/coffee/Email/EmailSenderTests.coffee +++ b/services/web/test/UnitTests/coffee/Email/EmailSenderTests.coffee @@ -37,7 +37,7 @@ describe "EmailSender", -> log:-> warn:-> err:-> - "../../infrastructure/Metrics": inc:-> + "metrics-sharelatex": inc:-> diff --git a/services/web/test/UnitTests/coffee/Project/ProjectControllerTests.coffee b/services/web/test/UnitTests/coffee/Project/ProjectControllerTests.coffee index b2cfb6efc1..87120deced 100644 --- a/services/web/test/UnitTests/coffee/Project/ProjectControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Project/ProjectControllerTests.coffee @@ -65,7 +65,7 @@ describe "ProjectController", -> "logger-sharelatex": log:-> err:-> - "../../infrastructure/Metrics": + "metrics-sharelatex": Timer:-> done:-> inc:-> diff --git a/services/web/test/UnitTests/coffee/Project/ProjectCreationHandlerTests.coffee b/services/web/test/UnitTests/coffee/Project/ProjectCreationHandlerTests.coffee index d9a8813c70..f88d1700fd 100644 --- a/services/web/test/UnitTests/coffee/Project/ProjectCreationHandlerTests.coffee +++ b/services/web/test/UnitTests/coffee/Project/ProjectCreationHandlerTests.coffee @@ -50,7 +50,7 @@ describe 'ProjectCreationHandler', -> './ProjectEntityHandler':@ProjectEntityHandler "settings-sharelatex": @Settings = {} 'logger-sharelatex': {log:->} - "../../infrastructure/Metrics": { + "metrics-sharelatex": { inc: ()->, timeAsyncMethod: ()-> } diff --git a/services/web/test/UnitTests/coffee/Project/ProjectGetterTests.coffee b/services/web/test/UnitTests/coffee/Project/ProjectGetterTests.coffee index e70ca97075..c7e159357a 100644 --- a/services/web/test/UnitTests/coffee/Project/ProjectGetterTests.coffee +++ b/services/web/test/UnitTests/coffee/Project/ProjectGetterTests.coffee @@ -16,7 +16,7 @@ describe "ProjectGetter", -> projects: {} users: {} ObjectId: ObjectId - "../../infrastructure/Metrics": timeAsyncMethod: sinon.stub() + "metrics-sharelatex": timeAsyncMethod: sinon.stub() "../../models/Project": Project: @Project = {} "../Collaborators/CollaboratorsHandler": @CollaboratorsHandler = {} "logger-sharelatex": diff --git a/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsControllerTests.coffee b/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsControllerTests.coffee index fef915423e..974b2e9329 100644 --- a/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsControllerTests.coffee @@ -14,7 +14,7 @@ describe 'TpdsController', -> 'logger-sharelatex': log:-> err:-> - "../../infrastructure/Metrics": inc:-> + "metrics-sharelatex": inc:-> @user_id = "dsad29jlkjas" diff --git a/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsUpdateSenderTests.coffee b/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsUpdateSenderTests.coffee index 6e95e4e100..75ca01b88f 100644 --- a/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsUpdateSenderTests.coffee +++ b/services/web/test/UnitTests/coffee/ThirdPartyDataStore/TpdsUpdateSenderTests.coffee @@ -42,7 +42,7 @@ describe 'TpdsUpdateSender', -> '../../models/Project': Project:@Project 'request':@request '../Collaborators/CollaboratorsHandler': @CollaboratorsHandler - "../../infrastructure/Metrics": + "metrics-sharelatex": inc:-> describe "_enqueue", -> diff --git a/services/web/test/UnitTests/coffee/ThirdPartyDataStore/UpdateMergerTests.coffee b/services/web/test/UnitTests/coffee/ThirdPartyDataStore/UpdateMergerTests.coffee index f1fced4625..1b00f20bde 100644 --- a/services/web/test/UnitTests/coffee/ThirdPartyDataStore/UpdateMergerTests.coffee +++ b/services/web/test/UnitTests/coffee/ThirdPartyDataStore/UpdateMergerTests.coffee @@ -24,7 +24,7 @@ describe 'UpdateMerger :', -> 'logger-sharelatex': log: -> err: -> - "../../infrastructure/Metrics": + "metrics-sharelatex": Timer:-> done:-> @project_id = "project_id_here" diff --git a/services/web/test/UnitTests/coffee/Uploads/ArchiveManagerTests.coffee b/services/web/test/UnitTests/coffee/Uploads/ArchiveManagerTests.coffee index eab3d2fcbd..fd6153efae 100644 --- a/services/web/test/UnitTests/coffee/Uploads/ArchiveManagerTests.coffee +++ b/services/web/test/UnitTests/coffee/Uploads/ArchiveManagerTests.coffee @@ -26,7 +26,7 @@ describe "ArchiveManager", -> @ArchiveManager = SandboxedModule.require modulePath, requires: "child_process": @child "logger-sharelatex": @logger - "../../infrastructure/Metrics": @metrics + "metrics-sharelatex": @metrics "fs": @fs = {} describe "extractZipArchive", -> diff --git a/services/web/test/UnitTests/coffee/Uploads/ProjectUploadControllerTests.coffee b/services/web/test/UnitTests/coffee/Uploads/ProjectUploadControllerTests.coffee index 764265424c..3049f60fb8 100644 --- a/services/web/test/UnitTests/coffee/Uploads/ProjectUploadControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Uploads/ProjectUploadControllerTests.coffee @@ -21,7 +21,7 @@ describe "ProjectUploadController", -> "./ProjectUploadManager" : @ProjectUploadManager = {} "./FileSystemImportManager" : @FileSystemImportManager = {} "logger-sharelatex" : @logger = {log: sinon.stub(), error: sinon.stub(), err:->} - "../../infrastructure/Metrics": @metrics + "metrics-sharelatex": @metrics '../Authentication/AuthenticationController': @AuthenticationController "fs" : @fs = {} diff --git a/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee b/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee index f2f886a4a6..ecb33495c4 100644 --- a/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserControllerTests.coffee @@ -77,7 +77,7 @@ describe "UserController", -> "logger-sharelatex": log:-> err:-> - "../../infrastructure/Metrics": inc:-> + "metrics-sharelatex": inc:-> @res = send: sinon.stub() diff --git a/services/web/test/UnitTests/coffee/User/UserCreatorTests.coffee b/services/web/test/UnitTests/coffee/User/UserCreatorTests.coffee index c26ee1c278..8470e5621f 100644 --- a/services/web/test/UnitTests/coffee/User/UserCreatorTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserCreatorTests.coffee @@ -21,7 +21,7 @@ describe "UserCreator", -> "../../models/User": User:@UserModel "./UserLocator":@UserLocator "logger-sharelatex":{log:->} - '../../infrastructure/Metrics': {timeAsyncMethod: ()->} + 'metrics-sharelatex': {timeAsyncMethod: ()->} @email = "bob.oswald@gmail.com" diff --git a/services/web/test/UnitTests/coffee/User/UserLocatorTests.coffee b/services/web/test/UnitTests/coffee/User/UserLocatorTests.coffee index bb1f4250c4..73c178f934 100644 --- a/services/web/test/UnitTests/coffee/User/UserLocatorTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserLocatorTests.coffee @@ -10,7 +10,7 @@ describe "UserLocator", -> @user = {_id:"12390i"} @UserLocator = SandboxedModule.require modulePath, requires: "../../infrastructure/mongojs": db: @db = { users: {} } - "../../infrastructure/Metrics": timeAsyncMethod: sinon.stub() + "metrics-sharelatex": timeAsyncMethod: sinon.stub() @db.users = findOne : sinon.stub().callsArgWith(1, null, @user) diff --git a/services/web/test/UnitTests/coffee/User/UserUpdaterTests.coffee b/services/web/test/UnitTests/coffee/User/UserUpdaterTests.coffee index b5de3df1cc..a6239e2e65 100644 --- a/services/web/test/UnitTests/coffee/User/UserUpdaterTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserUpdaterTests.coffee @@ -21,7 +21,7 @@ describe "UserUpdater", -> "logger-sharelatex": log:-> "./UserLocator":@UserLocator "../../infrastructure/mongojs":@mongojs - "../../infrastructure/Metrics": timeAsyncMethod: sinon.stub() + "metrics-sharelatex": timeAsyncMethod: sinon.stub() @stubbedUser = name:"bob" diff --git a/services/web/test/UnitTests/coffee/infrastructure/LockManager/getLockTests.coffee b/services/web/test/UnitTests/coffee/infrastructure/LockManager/getLockTests.coffee index a7271a59f6..ec0d0d4950 100644 --- a/services/web/test/UnitTests/coffee/infrastructure/LockManager/getLockTests.coffee +++ b/services/web/test/UnitTests/coffee/infrastructure/LockManager/getLockTests.coffee @@ -13,7 +13,7 @@ describe 'LockManager - getting the lock', -> createClient : () => auth:-> "settings-sharelatex":{redis:{}} - "./Metrics": inc:-> + "metrics-sharelatex": inc:-> @callback = sinon.stub() @doc_id = "doc-id-123" diff --git a/services/web/test/UnitTests/coffee/infrastructure/LockManager/tryLockTests.coffee b/services/web/test/UnitTests/coffee/infrastructure/LockManager/tryLockTests.coffee index 9f8d680b2d..98f624c70b 100644 --- a/services/web/test/UnitTests/coffee/infrastructure/LockManager/tryLockTests.coffee +++ b/services/web/test/UnitTests/coffee/infrastructure/LockManager/tryLockTests.coffee @@ -14,7 +14,7 @@ describe 'LockManager - trying the lock', -> auth:-> set: @set = sinon.stub() "settings-sharelatex":{redis:{}} - "./Metrics": inc:-> + "metrics-sharelatex": inc:-> @callback = sinon.stub() @doc_id = "doc-id-123"