Exportar (0) Imprimir
Expandir todo

DiagnosticMonitorConfiguration.PerformanceCounters (Propiedad)

Gets or sets the buffer configuration for performance counter data.

Espacio de nombres: Microsoft.WindowsAzure.Diagnostics
Ensamblado: Microsoft.WindowsAzure.Diagnostics (en microsoft.windowsazure.diagnostics.dll)

'Uso
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)

Valor de propiedad

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();
}


Cualquier miembro estático público (Shared en Visual Basic) de este tipo es seguro para subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Plataformas de desarrollo

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

Plataformas de destino

Adiciones de comunidad

Mostrar:
© 2015 Microsoft