Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/Throttlr.Api.RateLimit/Abstractions/ISystemClock.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace RateLimit.Throttlr.Abstractions
{
/// <summary>
/// Provides an abstraction for accessing the current UTC system clock.
/// Useful for unit testing and time-based rate limiting algorithms.
/// </summary>
public interface ISystemClock
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace RateLimit.Throttlr.Core.Counter
{
Expand Down
6 changes: 0 additions & 6 deletions src/Throttlr.Api.RateLimit/Core/FixedWindowRateLimiter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ internal class FixedWindowRateLimiter : IRateLimiter
private readonly ISystemClock _clock;
private readonly RateLimitPolicy _policy;

/// <summary>
/// Initializes a new instance of the <see cref="FixedWindowRateLimiter"/> class.
/// </summary>
/// <param name="store">Backing store for counters.</param>
/// <param name="clock">Clock abstraction for testability.</param>
/// <param name="policy">Rate limit policy definition.</param>
public FixedWindowRateLimiter(
IRateLimitStore store,
ISystemClock clock,
Expand Down
8 changes: 4 additions & 4 deletions src/Throttlr.Api.RateLimit/Core/RateLimitResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace RateLimit.Throttlr.Core
{
/// <summary>
/// Represents the result of a rate limit check.
/// </summary>
public sealed class RateLimitResult
{
/// <summary>
/// Represents the result of a rate limit check.
/// </summary>
{
private RateLimitResult(bool isAllowed, int? retryAfterSeconds = null)
{
IsAllowed = isAllowed;
Expand Down
4 changes: 0 additions & 4 deletions src/Throttlr.Api.RateLimit/Core/SlidingWindowRateLimiter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ internal class SlidingWindowRateLimiter : IRateLimiter
private readonly ISystemClock _clock;
private readonly RateLimitPolicy _policy;

/// <summary>
/// Initializes a new instance of the <see cref="SlidingWindowRateLimiter"/> class.
/// </summary>
public SlidingWindowRateLimiter(
IRateLimitStore store,
ISystemClock clock,
Expand All @@ -31,7 +28,6 @@ public SlidingWindowRateLimiter(
_policy = policy ?? throw new ArgumentNullException(nameof(policy));
}

/// <inheritdoc />
/// <inheritdoc />
public async Task<RateLimitResult> ShouldLimitAsync(
string key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ namespace RateLimit.Throttlr.Core.Store
internal class InMemoryRateLimitStore : IRateLimitStore
{
private readonly ConcurrentDictionary<string, RateLimitCounter> _counters;

/// <summary>
/// Initializes a new instance of the <see cref="InMemoryRateLimitStore"/> class.
/// </summary>

public InMemoryRateLimitStore()
{
_counters = new ConcurrentDictionary<string, RateLimitCounter>(
Expand Down
3 changes: 0 additions & 3 deletions src/Throttlr.Api.RateLimit/Core/SystemClock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

namespace RateLimit.Throttlr.Core
{
/// <summary>
/// Default implementation of <see cref="ISystemClock"/> that uses <see cref="DateTimeOffset.UtcNow"/>.
/// </summary>
public sealed class SystemClock : ISystemClock
{
/// <inheritdoc />
Expand Down
6 changes: 0 additions & 6 deletions src/Throttlr.Api.RateLimit/Core/TokenBucketRateLimiter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ public sealed class TokenBucketRateLimiter : IRateLimiter
private readonly int _capacity;
private readonly double _tokensPerSecond;

/// <summary>
/// Initializes a new instance of the <see cref="TokenBucketRateLimiter"/> class.
/// </summary>
/// <param name="store">The rate limit store.</param>
/// <param name="policy">The rate limit policy.</param>
/// <param name="clock">The system clock.</param>
public TokenBucketRateLimiter(
IRateLimitStore store,
ISystemClock clock,
Expand Down
Loading