Экспорт (0) Печать
Развернуть все

Свойство DiagnosticMonitorConfiguration.PerformanceCounters

Gets or sets the buffer configuration for performance counter data.

Пространство имен: Microsoft.WindowsAzure.Diagnostics
Сборка: Microsoft.WindowsAzure.Diagnostics (в microsoft.windowsazure.diagnostics.dll)

'Применение
Dim instance As DiagnosticMonitorConfiguration
Dim value As PerformanceCountersBufferConfiguration

value = instance.PerformanceCounters

instance.PerformanceCounters = value

public PerformanceCountersBufferConfiguration PerformanceCounters { get; set; }
/** @property */
/** @attribute CompilerGeneratedAttribute() */ 
public PerformanceCountersBufferConfiguration get_PerformanceCounters ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */ 
public void set_PerformanceCounters (PerformanceCountersBufferConfiguration value)

CompilerGeneratedAttribute 
public function get PerformanceCounters () : PerformanceCountersBufferConfiguration

CompilerGeneratedAttribute 
public function set PerformanceCounters (value : PerformanceCountersBufferConfiguration)

Значение свойства

Returns PerformanceCountersBufferConfiguration.

The PerformanceCounters property is used to specify the PerformanceCountersBufferConfiguration data buffer that is used for capturing performance metrics. This property enables you to add performance counters to the DataSources collection. You can also use it to specify the default data buffer properties: BufferQuotaInMB and ScheduledTransferPeriod.

Example

The following code snippet creates a new diagnostic monitor configuration, specifies the configuration for performance counters, then starts the diagnostic monitor using the new configuration.

public override bool OnStart()
{
    // 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
    });

    // Transfer the counters every 30 minutes.
    diagnosticConfiguration.PerformanceCounters.ScheduledTransferPeriod = TimeSpan.FromMinutes(30.0);

    // Start the DiagnosticMonitor using the diagnosticConfig and our connection string.
    DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnosticConfiguration);

    return base.OnStart();
}


Все открытые статические (Совместно используемая в Visual Basic) члены этого типа являются потокобезопасными. Потокобезопасность членов экземпляров не гарантируется.

Платформы разработки

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 и Windows 2000

Целевые платформы

Добавления сообщества

Показ:
© 2014 Microsoft