WebEventBufferFlushInfo Klass
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Innehåller parametrarna som definierar egenskaperna för tömningsbufferten.
public ref class WebEventBufferFlushInfo sealed
public sealed class WebEventBufferFlushInfo
type WebEventBufferFlushInfo = class
Public NotInheritable Class WebEventBufferFlushInfo
- Arv
-
WebEventBufferFlushInfo
Exempel
I följande kodexempel visas hur du WebEventBufferFlushInfo använder klassen. Det här kodexemplet är en del av ett större exempel för BufferedWebEventProvider klassen.
// 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
Kommentarer
ASP.NET hälsoövervakning gör det möjligt för produktions- och driftpersonal att hantera distribuerade webbprogram. Namnområdet System.Web.Management innehåller de hälsohändelsetyper som ansvarar för att paketera programhälsostatusdata och de leverantörstyper som ansvarar för bearbetning av dessa data. Den innehåller också stödtyper som hjälper till vid hantering av hälsohändelser.
Klassen WebEventBufferFlushInfo definierar värden som identifierar buffertens aktuella status. En instans av klassen skickas som en parameter till den ProcessEventFlush metod som bearbetar de meddelanden som har buffrats. ASP.NET hälsoövervakning anropar den här metoden när buffertens tömning krävs. Detta bestäms av de parametrar som definieras av elementet bufferModes i konfigurationsavsnittet healthMonitoring .
Note
Normalt kan buffringsmekanismen släppa vissa händelser för att hålla jämna steg med inkommande händelser. Det är upp till användaren att justera den här mekanismen genom att ändra elementet bufferModes i konfigurationsavsnittet healthMonitoring korrekt.
Egenskaper
| Name | Description |
|---|---|
| Events |
Hämtar händelsesamlingen i det aktuella meddelandet. |
| EventsDiscardedSinceLastNotification |
Hämtar antalet borttagna händelser sedan det senaste meddelandet. |
| EventsInBuffer |
Hämtar antalet händelser i bufferten. |
| LastNotificationUtc |
Hämtar datum och tid för det senaste meddelandet. |
| NotificationSequence |
Hämtar meddelandesekvensen i det aktuella meddelandet. |
| NotificationType |
Hämtar den aktuella meddelandetypen. |
Metoder
| Name | Description |
|---|---|
| Equals(Object) |
Avgör om det angivna objektet är lika med det aktuella objektet. (Ärvd från Object) |
| GetHashCode() |
Fungerar som standard-hash-funktion. (Ärvd från Object) |
| GetType() |
Hämtar den aktuella instansen Type . (Ärvd från Object) |
| MemberwiseClone() |
Skapar en ytlig kopia av den aktuella Object. (Ärvd från Object) |
| ToString() |
Returnerar en sträng som representerar det aktuella objektet. (Ärvd från Object) |