< Summary

Information
Class: IceRpc.Locator.LocatorOptions
Assembly: IceRpc.Locator
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Locator/LocatorOptions.cs
Tag: 275_13775359185
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 29
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 4
Total methods: 4
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Background()100%11100%
get_MaxCacheSize()100%11100%
get_RefreshThreshold()100%11100%
get_Ttl()100%11100%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Locator/LocatorOptions.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3namespace IceRpc.Locator;
 4
 5/// <summary>A property bag used to configure a <see cref="LocatorLocationResolver" />.</summary>
 6public sealed record class LocatorOptions
 7{
 8    /// <summary>Gets or sets a value indicating whether or not the locator must enable background lookups.</summary>
 9    /// <value>When <see langword="true" />, if the lookup finds a stale cache entry, it returns the stale entry's
 10    /// server address(es) and executes a call "in the background" to refresh this entry. Defaults to <see
 11    /// langword="false" />, meaning the lookup does not return stale values.</value>
 112    public bool Background { get; set; }
 13
 14    /// <summary>Gets or sets the maximum size of the cache.</summary>
 15    /// <value>The maximum size of the cache. <c>0</c> means no cache. Defaults to <c>100</c>.</value>
 816    public int MaxCacheSize { get; set; } = 100;
 17
 18    /// <summary>Gets or sets the refresh threshold. When the age of a cache entry is less than or equal to this
 19    /// value, it's considered up to date and won't be updated even when the caller requests a refresh.</summary>
 20    /// <value>The refresh threshold. Defaults to <c>1</c> second.</value>
 821    public TimeSpan RefreshThreshold { get; set; } = TimeSpan.FromSeconds(1);
 22
 23    /// <summary>Gets or sets the time-to-live. This is the time period after which a cache entry is considered
 24    /// stale.</summary>
 25    /// <value>The time to live. Defaults to <see cref="Timeout.InfiniteTimeSpan" />, meaning the cache entries never
 26    /// become stale.
 27    /// </value>
 1328    public TimeSpan Ttl { get; set; } = Timeout.InfiniteTimeSpan;
 29}