WebEventBufferFlushInfo Clase

Definición

Contiene los parámetros que definen las características de vaciado del búfer.

public ref class WebEventBufferFlushInfo sealed
public sealed class WebEventBufferFlushInfo
type WebEventBufferFlushInfo = class
Public NotInheritable Class WebEventBufferFlushInfo
Herencia
WebEventBufferFlushInfo

Ejemplos

En el ejemplo de código siguiente se muestra cómo se utiliza la clase WebEventBufferFlushInfo. Este ejemplo de código es parte de un ejemplo mayor proporcionado para la clase BufferedWebEventProvider.


// Processes the messages that have been buffered.
// It is called by the ASP.NET when the flushing of 
// the buffer is required.
public override void ProcessEventFlush(
    WebEventBufferFlushInfo flushInfo)
{

    // Customize event information to be sent to 
    // the Windows Event Viewer Application Log.
    customInfo.AppendLine(
        "SampleEventLogWebEventProvider buffer flush.");

    customInfo.AppendLine(
        string.Format("NotificationType: {0}",
        GetNotificationType(flushInfo)));

    customInfo.AppendLine(
        string.Format("EventsInBuffer: {0}",
        GetEventsInBuffer(flushInfo)));

    customInfo.AppendLine(
        string.Format(
        "EventsDiscardedSinceLastNotification: {0}",
        GetEventsDiscardedSinceLastNotification(flushInfo)));

    // Read each buffered event and send it to the
    // Application Log.
    foreach (WebBaseEvent eventRaised in flushInfo.Events)
        customInfo.AppendLine(eventRaised.ToString());

    // Store the information in the specified file.
    StoreToFile(customInfo, logFilePath, FileMode.Append);
}
    ' Processes the messages that have been buffered.
    ' It is called by the ASP.NET when the flushing of 
    ' the buffer is required according to the parameters 
    ' defined in the <bufferModes> element of the 
    ' <healthMonitoring> configuration section.
    Public Overrides Sub ProcessEventFlush(ByVal flushInfo _
    As WebEventBufferFlushInfo)

        ' Customize event information to be sent to 
        ' the Windows Event Viewer Application Log.
        customInfo.AppendLine( _
        "SampleEventLogWebEventProvider buffer flush.")

        customInfo.AppendLine(String.Format( _
        "NotificationType: {0}", _
        GetNotificationType(flushInfo)))

        customInfo.AppendLine(String.Format( _
        "EventsInBuffer: {0}", _
        GetEventsInBuffer(flushInfo)))

        customInfo.AppendLine(String.Format( _
        "EventsDiscardedSinceLastNotification: {0}", _
GetEventsDiscardedSinceLastNotification( _
flushInfo)))

        ' Read each buffered event and send it to the
        ' Application Log.
        Dim eventRaised As WebBaseEvent
        For Each eventRaised In flushInfo.Events
            customInfo.AppendLine(eventRaised.ToString())
        Next eventRaised
        ' Store the information in the specified file.
        StoreToFile(customInfo, logFilePath, _
        FileMode.Append)
    End Sub

Comentarios

ASP.NET supervisión del estado permite al personal de producción y operaciones administrar las aplicaciones web implementadas. El System.Web.Management espacio de nombres contiene los tipos de eventos de mantenimiento responsables de empaquetar los datos de estado de mantenimiento de la aplicación y los tipos de proveedor responsables de procesar estos datos. También contiene tipos auxiliares que ayudan durante la administración de eventos de mantenimiento.

La WebEventBufferFlushInfo clase define valores que identifican el estado actual del búfer. Una instancia de la clase se pasa como parámetro al ProcessEventFlush método que procesa los mensajes almacenados en búfer. ASP.NET la supervisión de estado llama a este método cuando se requiere el vaciado del búfer. Esto viene determinado por los parámetros definidos por el bufferModes elemento de la healthMonitoring sección de configuración.

Nota

Por diseño, el mecanismo de almacenamiento en búfer podría quitar algunos eventos para mantener el ritmo de los eventos entrantes. El usuario puede ajustar este mecanismo modificando correctamente el bufferModes elemento de la healthMonitoring sección de configuración.

Propiedades

Events

Obtiene la colección de eventos del mensaje actual.

EventsDiscardedSinceLastNotification

Obtiene el número de eventos descartados desde la última notificación.

EventsInBuffer

Obtiene el número de eventos que hay en el búfer.

LastNotificationUtc

Obtiene la fecha y la hora de la última notificación.

NotificationSequence

Obtiene la secuencia de mensajes de la notificación actual.

NotificationType

Obtiene el tipo de notificación actual.

Métodos

Equals(Object)

Determina si el objeto especificado es igual que el objeto actual.

(Heredado de Object)
GetHashCode()

Sirve como la función hash predeterminada.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Se aplica a

Consulte también