[misc] add a metric for failing downloads

This commit is contained in:
Jakob Ackermann
2020-03-26 11:18:50 +01:00
committed by Jakob Ackermann
parent 54ce1373af
commit 638d2f30d3
2 changed files with 2 additions and 0 deletions

View File

@@ -324,6 +324,7 @@ module.exports = ResourceWriter = {
}, },
'error downloading file for resources' 'error downloading file for resources'
) )
Metrics.inc('download-failed')
} }
return callback() return callback()
} }

View File

@@ -36,6 +36,7 @@ describe('ResourceWriter', function() {
'./OutputFileFinder': (this.OutputFileFinder = {}), './OutputFileFinder': (this.OutputFileFinder = {}),
'logger-sharelatex': { log: sinon.stub(), err: sinon.stub() }, 'logger-sharelatex': { log: sinon.stub(), err: sinon.stub() },
'./Metrics': (this.Metrics = { './Metrics': (this.Metrics = {
inc: sinon.stub(),
Timer: (Timer = (function() { Timer: (Timer = (function() {
Timer = class Timer { Timer = class Timer {
static initClass() { static initClass() {