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)
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
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 2008Target Platforms