Skip to content

Commit

Permalink
docs: Add ToString to ThrottlerPerTime
Browse files Browse the repository at this point in the history
  • Loading branch information
GregaMohorko committed Jul 31, 2024
1 parent d3d6996 commit e37e2f8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/GM.Utility/Throttling/ThrottlerPerTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ public ThrottlerPerTime((TimeSpan Time, int MaxExecutions)[] limits, ILogger log
_executionLogPosition = 0;
}

/// <summary>
/// Returns a string that represents this throttler.
/// </summary>
public override string ToString()
{
return string.Join(", ", Limits.Select(l => $"({l.MaxExecutions} per {l.Time})"));
}

/// <summary>
/// Waits until the next time there can be an execution, according to the set throttling settings.
/// <para>Thread-safe.</para>
Expand Down

0 comments on commit e37e2f8

Please sign in to comment.