Skip to content

Commit 7d7df8d

Browse files
samsp-msftBrennanConroyRick-Anderson
authored
Apply suggestions from code review
Co-authored-by: Brennan <brecon@microsoft.com> Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com>
1 parent 70777c3 commit 7d7df8d

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

aspnetcore/performance/rate-limit.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The following steps show how to use the rate limiting middleware in an ASP.NET C
6969
{
7070
options.GlobalLimiter = PartitionedRateLimiter.Create<HttpContext, string>(httpContext =>
7171
RateLimitPartition.GetFixedWindowLimiter(
72-
partitionKey: httpContext.User.Identity?.Name ?? httpContext.Request.Headers.Host. ToString(),
72+
partitionKey: httpContext.User.Identity?.Name ?? httpContext.Request.Headers.Host.ToString(),
7373
factory: partition => new FixedWindowRateLimiterOptions
7474
{
7575
AutoReplenishment = true,
@@ -388,7 +388,7 @@ The following code uses `CreateChained`:
388388

389389
For more information, see the [CreateChained source code](https://github.com/dotnet/runtime/blob/79874806d246670ee5fe76e73ce566578fe675c0/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/PartitionedRateLimiter.cs#L52-L64)
390390

391-
## Chosing what happens when a request is rate limited
391+
## Choosing what happens when a request is rate limited
392392

393393
For simple cases, you can just set the status code:
394394

@@ -473,14 +473,8 @@ In the preceding controller:
473473

474474
## Rate limiting metrics
475475

476-
The rate limiting middleware provides built-in metrics and monitoring capabilities to help understand how rate limits are affecting app performance and user experience. The following metrics are provided for rate limiting
476+
The rate limiting middleware provides [built-in metrics and monitoring](/aspnet/core/log-mon/metrics/metrics) capabilities to help understand how rate limits are affecting app performance and user experience. See [`Microsoft.AspNetCore.RateLimiting`](/dotnet/core/diagnostics/built-in-metrics-aspnetcore#microsoftaspnetcoreratelimiting) for a list of metrics.
477477

478-
| Metric | Description | Type |
479-
| --- | --- | --- |
480-
| `Microsoft.AspNetCore.RateLimiting.RequestsPerformed` | Counts successful (allowed) requests | Counter|
481-
| `Microsoft.AspNetCore.RateLimiting.RequestsRejected` | Counts rejected requests | Counter |
482-
| `Microsoft.AspNetCore.RateLimiting.CurrentLeases` | Current number of active leases | Gauge |
483-
| `Microsoft.AspNetCore.RateLimiting.CurrentQueuedRequests` | Current number of queued requests | Gauge |
484478
| `Microsoft.AspNetCore.RateLimiting.QueueTimeMs` | Time spent in queue | Histogram |
485479

486480
<a name="test7"></a>

0 commit comments

Comments
 (0)