IWMSServerCurrentCounters.AllCounters (Visual Basic .NET)

banner art

Previous Next

IWMSServerCurrentCounters.AllCounters (Visual Basic .NET)

The AllCounters property retrieves an array that contains all of the counters supported by the object.

Syntax

  Variant = IWMSServerCurrentCounters.AllCounters

Property Value

An array of Variant types containing the counters.

Remarks

This property is read-only. The array is two-dimensional. The first element in each row contains the name of the counter property, and the second element in each row contains the value. The AllCounters property is used to speed up counter retrieval during remote administration, by making one call instead of multiple calls to retrieve multiple counter properties.

The properties returned by the array are shown in the following table.

Property Description
CacheDownloads Retrieves the number of streams being sent to a cache.
ConnectedPlayers Retrieves the number of players connected to the server.
ConnectionQueue Retrieves the current number of players in the queue to connect to the server.
ConnectionRate Retrieves the number of players connecting per second.
FileReadRate Retrieves the current bandwidth consumed by file read operations.
IncomingBandwidth Retrieves the current bandwidth allocated for incoming connections.
LateReadRate Retrieves the number of late read operations per second.
LateSendRate Retrieves the number of late send operations per second.
OutgoingDistributionAllocatedBandwidth Retrieves the bandwidth that has been allocated for distribution connections.
OutgoingDistributionConnections Retrieves the number of server distribution connections.
OutgoingDistributionSendRate Retrieves the rate, in Kbps, at which content is being sent to distribution connections.
PlayerAllocatedBandwidth Retrieves the bandwidth allocated for player connections.
PlayerSendRate Retrieves the rate, in Kbps, at which content is being sent to players.
StreamErrorRate Retrieves the number of dropped packets per second.
StreamingHTTPPlayers Retrieves the total number of players receiving streamed content using the HTTP protocol.
StreamingMMSPlayers Retrieves the total number of players receiving streamed content using the MMS protocol. (The MMS protocol is not supported in Windows Server 2008 operating systems.)
StreamingPlayers Retrieves the number of players receiving streamed content.
StreamingRTSPPlayers Retrieves the number of players receiving streamed content using the RTSP protocol.
StreamingUDPPlayers Retrieves the number of players receiving streamed content using the User Datagram Protocol (UDP).
UDPResendRequestsRate Retrieves the number of UDP resend requests received by the server.
UDPResendsSentRate Retrieves the number of UDP resend requests processed by the server.

Example Code

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub GetAllCounters()

    ' Declare variables.
    Dim Server As WMSServer
    Dim CurrentCounters As IWMSServerCurrentCounters
    Dim aAllCounters As Object
    Dim varValue As Object
    Dim i As Integer
    Dim j As Integer

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve a list of current statistics
    ' for the server.
    CurrentCounters = Server.CurrentCounters

    ' Retrieve an array of all the counters in this object.
    aAllCounters = CurrentCounters.AllCounters

    ' Process each array element.
    For i = LBound(aAllCounters) To UBound(aAllCounters)

        For j = LBound(aAllCounters, 2) To UBound(aAllCounters, 2)

            varValue = aAllCounters(i, j)

            If TypeName(varValue) = "String" Then
                ' TODO: Handle counter names.
            End If

            If TypeName(varValue) = "Integer" Then
                ' TODO: Handle counter values.
            End If

        Next j

    Next i

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

  • Note   Some counters are not available in the Windows Server 2003 family.

See Also

Previous Next