.NET Event Tracing Class Library  

EventTraceRealTimeLog Class

Event tracing analysis can also be achieved in real-time. This class makes it simpler to create a log file to represent a real-time session.

For a list of all members of this type, see EventTraceRealTimeLog Members.

System.Object
    WmiSolutions.EventTracing.Consumer.EventTraceLogFile
       WmiSolutions.EventTracing.Consumer.EventTraceRealTimeLog

[Visual Basic]
Public Class EventTraceRealTimeLog Inherits EventTraceLogFile
[C#]
public class EventTraceRealTimeLog : EventTraceLogFile
[C++]
public __gc class EventTraceRealTimeLog : public EventTraceLogFile

Example

[C#]
    using System;
    using WmiSolutions.EventTracing;
    using WmiSolutions.EventTracing.Consumer;

    EventTraceRealTimeLog realtime = new EventTraceRealTimeLog("My Real-Time Session");
	
    MyHandler handler = new MyHandler();
    realtime.EndOfBuffer += new EndOfBufferEventHandler(handler.EndOfBufferHandler); 
    realtime.TraceEvent += new TraceEventHandler(handler.TraceEventHandler); 

    EventTraceProcessLogs process = new EventTraceProcessLogs();
    process.AddTrace(realtime);

    EventTraceOperationObserver observer = new EventTraceOperationObserver();
    MyProcessHandler procHandler = new MyProcessHandler();
    observer.Completed += new CompletedEventHandler(procHandler.CompletedHandler); 
    process.Process(observer);

    while (!procHandler.Completed) 
    {
        Console.WriteLine("  Waiting 1000ms...");
        System.Threading.Thread.Sleep(1000);
    }

    process.CloseAllTraces();
    
[Visual Basic]

    Imports System
    Imports WmiSolutions.EventTracing
    Imports WmiSolutions.EventTracing.Consumer
 
    Dim realtime As EventTraceRealTimeLog =  New EventTraceRealTimeLog("My Real-Time Session") 
 
    Dim handler As MyHandler =  New MyHandler() 
    AddHandler realtime.EndOfBuffer, AddressOf handler.EndOfBufferHandler
    AddHandler realtime.TraceEvent, AddressOf handler.TraceEventHandler
 
    Dim process As EventTraceProcessLogs =  New EventTraceProcessLogs() 
    process.AddTrace(realtime)
 
    Dim observer As EventTraceOperationObserver =  New EventTraceOperationObserver() 
    Dim procHandler As MyProcessHandler =  New MyProcessHandler() 
    AddHandler observer.Completed, AddressOf procHandler.CompletedHandler

    process.Process(observer)
 
    While Not procHandler.Completed
        Console.WriteLine("  Waiting 1000ms...")
        System.Threading.Thread.Sleep(1000)
    End While
 
    process.CloseAllTraces()
    

Requirements

Namespace: WmiSolutions.EventTracing.Consumer

Platforms: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: WmiSolutions.EventTracing.Consumer (in WmiSolutions.EventTracing.dll)

 

See Also

TraceMessageEventArgs Members | TraceEventFieldBitmaskCollection Members | TraceEventFieldBitmask Members | TraceEventField Members | TraceEventArgs Members | EventTraceRealTimeLog Members | EventTraceProcessLogs Members | EventTraceOperationObserver Members | EventTraceMessage Members | EventTraceLogFile Members | EventTraceFieldCollection Members | EventTraceEvent Members | EndOfBufferEventArgs Members | CompletedEventArgs Members

Contact Me   |  Developing WMI Solutions    |   Gwyn Cole's Developer Blog    |   Legal
 © 2003 Content by Gwyn Cole. All rights reserved.