mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-09 04:16:02 +00: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:
parent
401ed57890
commit
80e9afe42c
2 changed files with 4 additions and 7 deletions
|
@ -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()
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue