mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 21:53:43 +01:00
Merge pull request #2586 from overleaf/bg-simplify-rate-limit-metrics
simplify metric for rate limits GitOrigin-RevId: bba98c7e38846aedcfcf0781003f755e302f7759
This commit is contained in:
@@ -27,7 +27,7 @@ const RateLimiter = {
|
||||
}
|
||||
const allowed = timeLeft === 0
|
||||
if (!allowed) {
|
||||
Metrics.inc(`rate-limit-hit.${opts.endpointName}`, 1, {
|
||||
Metrics.inc('rate-limit-hit', 1, {
|
||||
path: opts.endpointName
|
||||
})
|
||||
}
|
||||
|
||||
@@ -132,12 +132,9 @@ describe('RateLimiter', function() {
|
||||
return this.limiter.addCount(
|
||||
{ endpointName: this.endpointName },
|
||||
(err, should) => {
|
||||
sinon.assert.calledWith(
|
||||
this.Metrics.inc,
|
||||
`rate-limit-hit.${this.endpointName}`,
|
||||
1,
|
||||
{ path: this.endpointName }
|
||||
)
|
||||
sinon.assert.calledWith(this.Metrics.inc, `rate-limit-hit`, 1, {
|
||||
path: this.endpointName
|
||||
})
|
||||
return done()
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user