IWMSServerCurrentCounters.AllCounters (C#)
.gif)
| Previous | Next |
IWMSServerCurrentCounters.AllCounters (C#)
The AllCounters property retrieves an array that contains all of the counters supported by the object.
Syntax
object[,] = IWMSServerCurrentCounters.AllCounters;
Property Value
An object array 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
using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;
// Declare variables.
WMSServer Server;
IWMSServerCurrentCounters CurrentCounters;
object[,] aAllCounters;
try {
// Create a new WMSServer object.
Server = new WMSServerClass();
// Retrieve a list of current statistics for the server.
CurrentCounters = Server.CurrentCounters;
// Retrieve an array of all the counters in this object.
aAllCounters = (object[,])CurrentCounters.AllCounters;
// Process each array element.
for (int j = aAllCounters.GetLowerBound(0); j <=
aAllCounters.GetUpperBound(0); j++)
{
for (int k = aAllCounters.GetLowerBound(1); k <=
aAllCounters.GetUpperBound(1); k++)
{
object varValue;
varValue = aAllCounters[j, k];
if (varValue.GetType().ToString() == "System.String")
{
// TODO: Handle counter names.
}
if (varValue.GetType().ToString() == "System.Int32")
{
// TODO: Handle counter values.
}
}
}
}
catch (COMException comExc) {
// TODO: Handle COM exceptions.
}
catch (Exception e) {
// TODO: Handle exceptions.
}
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 |