< Summary

Information
Class: IceRpc.Transports.Coloc.ColocTransportOptions
Assembly: IceRpc.Transports.Coloc
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Transports.Coloc/ColocTransportOptions.cs
Tag: 275_13775359185
Line coverage
100%
Covered lines: 22
Uncovered lines: 0
Coverable lines: 22
Total lines: 51
Line coverage: 100%
Branch coverage
50%
Covered branches: 4
Total branches: 8
Branch coverage: 50%
Method coverage
100%
Covered methods: 7
Total methods: 7
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ListenBacklog()100%11100%
set_ListenBacklog(...)50%22100%
get_PauseWriterThreshold()100%11100%
set_PauseWriterThreshold(...)50%22100%
get_ResumeWriterThreshold()100%11100%
set_ResumeWriterThreshold(...)50%44100%
.ctor()100%11100%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Transports.Coloc/ColocTransportOptions.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3namespace IceRpc.Transports.Coloc;
 4
 5/// <summary>A property bag used to configure a <see cref="ColocTransport" />.</summary>
 6public sealed record class ColocTransportOptions
 7{
 8    /// <summary>Gets or sets the maximum length of the pending connections queue.</summary>
 9    /// <value>The maximum queue length. The value cannot be less than <c>1</c>. Defaults to <c>511</c>.</value>
 10    public int ListenBacklog
 11    {
 98612        get => _listenBacklog;
 1413        set => _listenBacklog = value >= 1 ? value :
 1414            throw new ArgumentOutOfRangeException(
 1415                nameof(value),
 1416                $"Invalid value '{value}' for {nameof(ListenBacklog)}, it cannot be less than 1.");
 17    }
 18
 19    /// <summary>Gets or sets the number of bytes in the Coloc connection when <see cref="IDuplexConnection.WriteAsync"
 20    /// /> starts blocking.</summary>
 21    /// <value>The pause writer threshold. The value cannot be less than <c>1</c> KB. Defaults to <c>64</c> KB.</value>
 22    public int PauseWriterThreshold
 23    {
 199324        get => _pauseWriterThreshold;
 625        set => _pauseWriterThreshold = value >= 1024 ? value :
 626            throw new ArgumentOutOfRangeException(
 627                nameof(value),
 628                $"Invalid value '{value}' for {nameof(PauseWriterThreshold)}, it cannot be less than 1KB.");
 29    }
 30
 31    /// <summary>Gets or sets the number of bytes in the Coloc connection when <see cref="IDuplexConnection.WriteAsync"
 32    /// /> stops blocking.</summary>
 33    /// <value>The resume writer threshold. The value cannot be less than <c>1</c> KB and cannot be greater than <see
 34    /// cref="PauseWriterThreshold"/>. Defaults to <c>32</c> KB.</value>
 35    public int ResumeWriterThreshold
 36    {
 199337        get => _resumeWriterThreshold;
 638        set => _resumeWriterThreshold =
 639            value < 1024 ? throw new ArgumentOutOfRangeException(
 640                nameof(value),
 641                $"Invalid value '{value}' for {nameof(ResumeWriterThreshold)}, it cannot be less than 1KB.") :
 642            value > _pauseWriterThreshold ? throw new ArgumentException(
 643                $"The value of {nameof(ResumeWriterThreshold)} cannot be greater than the value of {nameof(PauseWriterTh
 644                nameof(value)) :
 645            value;
 46    }
 47
 97848    private int _listenBacklog = 511;
 97849    private int _pauseWriterThreshold = 65536;
 97850    private int _resumeWriterThreshold = 32768;
 51}