< Summary - Kestrun — Combined Coverage

Information
Class: Public.SignalR.Get-KrSignalRConnectedClient
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/SignalR/Get-KrSignalRConnectedClient.ps1
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
Total lines: 33
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 10/15/2025 - 21:27:26 Line coverage: 0% (0/2) Total lines: 33 Tag: Kestrun/Kestrun@c33ec02a85e4f8d6061aeaab5a5e8c3a8b665594

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/SignalR/Get-KrSignalRConnectedClient.ps1

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Gets the number of connected SignalR clients.
 4    .DESCRIPTION
 5        This function retrieves the current number of connected SignalR clients from the IConnectionTracker service.
 6        It can be used to monitor the number of active connections to the SignalR hub.
 7    .PARAMETER Server
 8        The Kestrun server instance. If not specified, the default server is used.
 9    .EXAMPLE
 10        Get-KrSignalRConnectedClient
 11        Retrieves the number of connected SignalR clients from the default Kestrun server.
 12    .EXAMPLE
 13        Get-KrServer | Get-KrSignalRConnectedClient
 14        Retrieves the number of connected SignalR clients using the pipeline.
 15    .NOTES
 16        This function requires that SignalR has been configured on the server using Add-KrSignalR
 17#>
 18function Get-KrSignalRConnectedClient {
 19    [KestrunRuntimeApi('Everywhere')]
 20    [CmdletBinding()]
 21    [outputtype([System.Nullable`1[System.Int32]])]
 22    param(
 23        [Parameter(Mandatory = $false, ValueFromPipeline = $true)]
 24        [Kestrun.Hosting.KestrunHost]$Server
 25    )
 26    begin {
 27        # Ensure the server instance is resolved
 028        $Server = Resolve-KestrunServer -Server $Server
 29    }
 30    process {
 031        return [Kestrun.Hosting.KestrunHostSignalRExtensions]::GetConnectedClientCount($Server)
 32    }
 33}

Methods/Properties

Get-KrSignalRConnectedClient()