(resourceClass, resourceId, limitConfig)
| 143 | } |
| 144 | |
| 145 | function buildRateChecksFromConfig(resourceClass, resourceId, limitConfig) { |
| 146 | const checks = []; |
| 147 | if (limitConfig?.RequestsPerSecond?.Limit > 0) { |
| 148 | checks.push({ |
| 149 | resourceClass, |
| 150 | resourceId, |
| 151 | measure: 'rps', |
| 152 | source: limitConfig.RequestsPerSecond.source, |
| 153 | config: { |
| 154 | limit: limitConfig.RequestsPerSecond.Limit, |
| 155 | burstCapacity: limitConfig.RequestsPerSecond.BurstCapacity * 1000, |
| 156 | }, |
| 157 | }); |
| 158 | } |
| 159 | |
| 160 | return checks; |
| 161 | } |
| 162 | |
| 163 | function checkRateLimitsForRequest(checks, log) { |
| 164 | const buckets = []; |
no outgoing calls
no test coverage detected