IWMSServerPeakCounters.AllCounters (Visual Basic .NET)

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

Variant = IWMSServerPeakCounters.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

ConnectedPlayers

Retrieves the maximum number of players that have simultaneously connected to the server since the last reset.

OutgoingDistributionAllocatedBandwidth

Retrieves the maximum bandwidth allocated to distribution connections since the last reset.

OutgoingDistributionConnections

Retrieves the maximum number of simultaneous distribution connections since the last reset.

OutgoingDistributionSendRate

Retrieves the maximum number of bytes per second sent to distribution connections since the last reset.

PlayerAllocatedBandwidth

Retrieves the maximum bandwidth allocated to player connections since the last reset.

PlayerSendRate

Retrieves the maximum number of bytes per second sent to player connections since the last reset.

StreamingPlayers

Retrieves the maximum number of players that received content from the server simultaneously since the last reset.

StreamingHTTPPlayers

Retrieves the maximum number of players that received content by using the HTTP protocol from the server simultaneously since the last reset.

StreamingRTSPPlayers

Retrieves the maximum number of players that received content by using the RTSP protocol from the server simultaneously since the last reset.

StreamingUDPPlayers

Retrieves the maximum number of players that received content by using the User Datagram Protocol (UDP) from the server simultaneously since the last reset.

Example

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

Private Sub GetAllCounters()

    ' Declare variables.
    Dim Server As WMSServer
    Dim PeakCounters As IWMSServerPeakCounters
    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 peak statistics
    ' for the server.
    PeakCounters = Server.PeakCounters

    ' Retrieve an array of all the counters in this object.
    aAllCounters = PeakCounters.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

Reference

IWMSServerPeakCounters Object (Visual Basic .NET)