WebEventBufferFlushInfo Klasa

Definicja

Zawiera parametry definiujące charakterystykę buforu opróżniania.

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

Przykłady

W poniższym przykładzie kodu pokazano, jak używać WebEventBufferFlushInfo klasy. Ten przykład kodu jest częścią większego przykładu podanego BufferedWebEventProvider dla klasy.


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

Uwagi

ASP.NET monitorowanie kondycji umożliwia pracownikom produkcyjnym i operacyjnym zarządzanie wdrożonych aplikacji internetowych. System.Web.Management Przestrzeń nazw zawiera typy zdarzeń kondycji odpowiedzialne za pakowanie danych o stanie kondycji aplikacji i typów dostawców odpowiedzialnych za przetwarzanie tych danych. Zawiera również typy pomocnicze, które pomagają podczas zarządzania zdarzeniami kondycji.

Klasa WebEventBufferFlushInfo definiuje wartości identyfikujące bieżący stan buforu. Wystąpienie klasy jest przekazywane jako parametr ProcessEventFlush do metody, która przetwarza komunikaty, które zostały buforowane. ASP.NET monitorowanie kondycji wywołuje tę metodę, gdy wymagane jest opróżnienie buforu. Jest to określane przez parametry zdefiniowane przez bufferModes element w healthMonitoring sekcji konfiguracji.

Uwaga

Zgodnie z projektem mechanizm buforowania może porzucić niektóre zdarzenia, aby zachować tempo zdarzeń przychodzących. Do użytkownika należy dostosowanie tego mechanizmu przez prawidłowe zmodyfikowanie bufferModes elementu w healthMonitoring sekcji konfiguracji.

Właściwości

Events

Pobiera kolekcję zdarzeń w bieżącym komunikacie.

EventsDiscardedSinceLastNotification

Pobiera liczbę zdarzeń porzuconych od ostatniego powiadomienia.

EventsInBuffer

Pobiera liczbę zdarzeń w buforze.

LastNotificationUtc

Pobiera datę i godzinę ostatniego powiadomienia.

NotificationSequence

Pobiera sekwencję komunikatów w bieżącym powiadomieniu.

NotificationType

Pobiera bieżący typ powiadomienia.

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy

Zobacz też