WebEventBufferFlushInfo Classe

Definição

Contém os parâmetros que definem as características do buffer de flush.

public ref class WebEventBufferFlushInfo sealed
public sealed class WebEventBufferFlushInfo
type WebEventBufferFlushInfo = class
Public NotInheritable Class WebEventBufferFlushInfo
Herança
WebEventBufferFlushInfo

Exemplos

O exemplo de código seguinte mostra como usar a WebEventBufferFlushInfo classe. Este exemplo de código faz parte de um exemplo maior fornecido para a BufferedWebEventProvider classe.


// 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

Observações

A monitorização do estado do ASP.NET permite que as equipas de produção e operações gerenciem aplicações Web implementadas. O System.Web.Management namespace contém os tipos de eventos de saúde responsáveis por empacotar os dados de estado de saúde da aplicação e os tipos de fornecedores responsáveis pelo processamento desses dados. Inclui também tipos de apoio que ajudam na gestão de eventos de saúde.

A WebEventBufferFlushInfo classe define valores que identificam o estado atual do buffer. Uma instância da classe é passada como parâmetro ao ProcessEventFlush método que processa as mensagens que foram armazenadas em buffer. A monitorização da saúde do ASP.NET chama este método quando é necessário o esvazio do buffer. Isto é determinado pelos parâmetros definidos pelo bufferModes elemento na healthMonitoring secção de configuração.

Note

Por conceção, o mecanismo de buffering pode eliminar alguns eventos para acompanhar os eventos recebidos. Cabe ao utilizador ajustar este mecanismo, modificando corretamente o bufferModes elemento na secção de healthMonitoring configuração.

Propriedades

Name Description
Events

Obtém a coleção de eventos na mensagem atual.

EventsDiscardedSinceLastNotification

Obtém o número de eventos eliminados desde a última notificação.

EventsInBuffer

Obtém o número de eventos no buffer.

LastNotificationUtc

Obtém a data e a hora da última notificação.

NotificationSequence

Recebe a sequência de mensagens na notificação atual.

NotificationType

Recebe o tipo de notificação atual.

Métodos

Name Description
Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetHashCode()

Serve como função de hash predefinida.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do atual Object.

(Herdado de Object)
ToString()

Devolve uma cadeia que representa o objeto atual.

(Herdado de Object)

Aplica-se a

Ver também