C# Class Axiom.Core.MeterManager

The MeterManager creates and hands out TimingMeter instances. Those instances are looked up by meter "title", a string name for the meter. Meter instances also have a string "category", so you can turn metering on and off by category. All public methods of MeterManager are static, so the user doesn't have to worry about managing the instance of MeterManager. The workflow is that the user program creates several meters by calling the static MakeMeter method, passing the title and category of the meter. That method looks up the meter by title, creating it if it doesn't already exists, and returns the meter. Thereafter, the user invokes the TimingMeter.Enter() and TimingMeter.Exit() methods, each of which causes the MeterManager to add a record to a collection of entries and exits. The record has the identity of the meter; whether it's an entry or exit, and the time in processor ticks, captured using the assembler primitive RDTSC. At any point, the program can call the method MeterManager.Report, which produces a report based on the trace.
Datei anzeigen Open project: WolfgangSt/axiom Class Usage Examples

Public Properties

Property Type Description
DontDisplayUsecs int
MeterEventsFilename string
MeterLogFilename string

Protected Properties

Property Type Description
collecting bool
dumpEventLog bool
instance MeterManager
metersById TimingMeter>.Dictionary
startTime long
timerIdCounter short

Public Methods

Method Description
AddEvent ( TimingMeter meter, short eventKind, string info ) : int
AddInfoEvent ( string info ) : void
ClearEvents ( ) : void
EnableCategory ( string categoryName, bool enable ) : void
EnableOnlyCategory ( string categoryName, bool enable ) : void
GetMeter ( string title, string category ) : TimingMeter
GetMeter ( string title, string category, bool accumulate ) : TimingMeter
Init ( ) : void
Report ( string title ) : void
Report ( string title, StreamWriter writer, int start, string optionsString ) : void
SaveToFile ( string pathname ) : void
StartTime ( ) : long

Protected Methods

Method Description
BarfOnBadChars ( string name, string nameDescription ) : void
BoolOption ( string name, string>.Dictionary options ) : bool
CaptureCurrentTime ( ) : long
DumpEventLog ( ) : void
GenerateReport ( StreamWriter writer, int start, string>.Dictionary options ) : void
GetMeterById ( int id ) : TimingMeter
IndentCount ( int count ) : string
IntOption ( string name, string>.Dictionary options ) : int
MeterManager ( ) : System
OptionValue ( string name, string>.Dictionary options ) : string
SaveToFileInternal ( string pathname ) : void
ToMicroseconds ( long ticks ) : long

Private Methods

Method Description
DebugAddEvent ( TimingMeter meter, MeterEvent evt ) : void

Method Details

AddEvent() public static method

public static AddEvent ( TimingMeter meter, short eventKind, string info ) : int
meter TimingMeter
eventKind short
info string
return int

AddInfoEvent() public static method

public static AddInfoEvent ( string info ) : void
info string
return void

BarfOnBadChars() protected static method

protected static BarfOnBadChars ( string name, string nameDescription ) : void
name string
nameDescription string
return void

BoolOption() protected method

protected BoolOption ( string name, string>.Dictionary options ) : bool
name string
options string>.Dictionary
return bool

CaptureCurrentTime() protected static method

protected static CaptureCurrentTime ( ) : long
return long

ClearEvents() public static method

public static ClearEvents ( ) : void
return void

DumpEventLog() protected method

protected DumpEventLog ( ) : void
return void

EnableCategory() public static method

public static EnableCategory ( string categoryName, bool enable ) : void
categoryName string
enable bool
return void

EnableOnlyCategory() public static method

public static EnableOnlyCategory ( string categoryName, bool enable ) : void
categoryName string
enable bool
return void

GenerateReport() protected method

protected GenerateReport ( StreamWriter writer, int start, string>.Dictionary options ) : void
writer System.IO.StreamWriter
start int
options string>.Dictionary
return void

GetMeter() public static method

public static GetMeter ( string title, string category ) : TimingMeter
title string
category string
return TimingMeter

GetMeter() public static method

public static GetMeter ( string title, string category, bool accumulate ) : TimingMeter
title string
category string
accumulate bool
return TimingMeter

GetMeterById() protected method

protected GetMeterById ( int id ) : TimingMeter
id int
return TimingMeter

IndentCount() protected method

protected IndentCount ( int count ) : string
count int
return string

Init() public static method

public static Init ( ) : void
return void

IntOption() protected method

protected IntOption ( string name, string>.Dictionary options ) : int
name string
options string>.Dictionary
return int

MeterManager() protected method

protected MeterManager ( ) : System
return System

OptionValue() protected method

protected OptionValue ( string name, string>.Dictionary options ) : string
name string
options string>.Dictionary
return string

Report() public static method

public static Report ( string title ) : void
title string
return void

Report() public static method

public static Report ( string title, StreamWriter writer, int start, string optionsString ) : void
title string
writer System.IO.StreamWriter
start int
optionsString string
return void

SaveToFile() public static method

public static SaveToFile ( string pathname ) : void
pathname string
return void

SaveToFileInternal() protected method

protected SaveToFileInternal ( string pathname ) : void
pathname string
return void

StartTime() public static method

public static StartTime ( ) : long
return long

ToMicroseconds() protected method

protected ToMicroseconds ( long ticks ) : long
ticks long
return long

Property Details

DontDisplayUsecs public_oe static_oe property

public static int DontDisplayUsecs
return int

MeterEventsFilename public_oe static_oe property

public static string MeterEventsFilename
return string

MeterLogFilename public_oe static_oe property

public static string MeterLogFilename
return string

collecting protected_oe property

protected bool collecting
return bool

dumpEventLog protected_oe static_oe property

protected static bool dumpEventLog
return bool

instance protected_oe static_oe property

protected static MeterManager,Axiom.Core instance
return MeterManager

metersById protected_oe property

protected Dictionary metersById
return TimingMeter>.Dictionary

startTime protected_oe property

protected long startTime
return long

timerIdCounter protected_oe property

protected short timerIdCounter
return short