This topic has not yet been rated - Rate this topic

PerformanceCountersBufferConfiguration.DataSources Property

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)
'Usage
Dim instance As PerformanceCountersBufferConfiguration
Dim value As IList(Of PerformanceCounterConfiguration)

value = instance.DataSources

public IList<PerformanceCounterConfiguration> DataSources { get; }
/** @property */
public IList<PerformanceCounterConfiguration> get_DataSources ()

public function get DataSources () : IList<PerformanceCounterConfiguration>

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

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ