Export (0) Print
Expand All

PerformanceCountersBufferConfiguration.DataSources Property

Updated: April 24, 2011

Gets a list of configurations for performance counters that are being collected.

Namespace: Microsoft.WindowsAzure.Diagnostics
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)

public IList<PerformanceCounterConfiguration> DataSources { get; }

Property Value

Type: System.Collections.Generic.IList

Returns IList.

The DataSources collection stores the list of PerformanceCounterConfiguration objects for each performance counter in a role instance. This property is used when retrieving or adding a PerformanceCounterConfiguration object to PerformanceCounters for your diagnostic monitor configuration, as PerformanceCounters is of type PerformanceCountersBufferConfiguration.

The following code snippet creates a new PerformanceCounterConfiguration object and adds the specified configuration to a DiagnosticMonitorConfiguration object:

// Get the default initial configuration for DiagnosticMonitor.
DiagnosticMonitorConfiguration diagnosticConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration();

// Use 30 seconds for the performance counter sample rate.
TimeSpan perfSampleRate = TimeSpan.FromSeconds(30.0);

// Add a performance counter for requests per second.
diagnosticConfiguration.PerformanceCounters.DataSources.Add(new PerformanceCounterConfiguration()
{
    CounterSpecifier = @"\ASP.NET\Requests/Sec",
    SampleRate = perfSampleRate
});



Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows 7 and Windows Server 2008

Target Platforms

Community Additions

ADD
Show:
© 2014 Microsoft