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.
Afficher le fichier Open project: WolfgangSt/axiom Class Usage Examples

Méthodes publiques

Свойство Type Description
DontDisplayUsecs int
MeterEventsFilename string
MeterLogFilename string

Protected Properties

Свойство Type Description
collecting bool
dumpEventLog bool
instance MeterManager
metersById TimingMeter>.Dictionary
startTime long
timerIdCounter short

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode Description
DebugAddEvent ( TimingMeter meter, MeterEvent evt ) : void

Method Details

AddEvent() public static méthode

public static AddEvent ( TimingMeter meter, short eventKind, string info ) : int
meter TimingMeter
eventKind short
info string
Résultat int

AddInfoEvent() public static méthode

public static AddInfoEvent ( string info ) : void
info string
Résultat void

BarfOnBadChars() protected static méthode

protected static BarfOnBadChars ( string name, string nameDescription ) : void
name string
nameDescription string
Résultat void

BoolOption() protected méthode

protected BoolOption ( string name, string>.Dictionary options ) : bool
name string
options string>.Dictionary
Résultat bool

CaptureCurrentTime() protected static méthode

protected static CaptureCurrentTime ( ) : long
Résultat long

ClearEvents() public static méthode

public static ClearEvents ( ) : void
Résultat void

DumpEventLog() protected méthode

protected DumpEventLog ( ) : void
Résultat void

EnableCategory() public static méthode

public static EnableCategory ( string categoryName, bool enable ) : void
categoryName string
enable bool
Résultat void

EnableOnlyCategory() public static méthode

public static EnableOnlyCategory ( string categoryName, bool enable ) : void
categoryName string
enable bool
Résultat void

GenerateReport() protected méthode

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

GetMeter() public static méthode

public static GetMeter ( string title, string category ) : TimingMeter
title string
category string
Résultat TimingMeter

GetMeter() public static méthode

public static GetMeter ( string title, string category, bool accumulate ) : TimingMeter
title string
category string
accumulate bool
Résultat TimingMeter

GetMeterById() protected méthode

protected GetMeterById ( int id ) : TimingMeter
id int
Résultat TimingMeter

IndentCount() protected méthode

protected IndentCount ( int count ) : string
count int
Résultat string

Init() public static méthode

public static Init ( ) : void
Résultat void

IntOption() protected méthode

protected IntOption ( string name, string>.Dictionary options ) : int
name string
options string>.Dictionary
Résultat int

MeterManager() protected méthode

protected MeterManager ( ) : System
Résultat System

OptionValue() protected méthode

protected OptionValue ( string name, string>.Dictionary options ) : string
name string
options string>.Dictionary
Résultat string

Report() public static méthode

public static Report ( string title ) : void
title string
Résultat void

Report() public static méthode

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

SaveToFile() public static méthode

public static SaveToFile ( string pathname ) : void
pathname string
Résultat void

SaveToFileInternal() protected méthode

protected SaveToFileInternal ( string pathname ) : void
pathname string
Résultat void

StartTime() public static méthode

public static StartTime ( ) : long
Résultat long

ToMicroseconds() protected méthode

protected ToMicroseconds ( long ticks ) : long
ticks long
Résultat long

Property Details

DontDisplayUsecs public_oe static_oe property

public static int DontDisplayUsecs
Résultat int

MeterEventsFilename public_oe static_oe property

public static string MeterEventsFilename
Résultat string

MeterLogFilename public_oe static_oe property

public static string MeterLogFilename
Résultat string

collecting protected_oe property

protected bool collecting
Résultat bool

dumpEventLog protected_oe static_oe property

protected static bool dumpEventLog
Résultat bool

instance protected_oe static_oe property

protected static MeterManager,Axiom.Core instance
Résultat MeterManager

metersById protected_oe property

protected Dictionary metersById
Résultat TimingMeter>.Dictionary

startTime protected_oe property

protected long startTime
Résultat long

timerIdCounter protected_oe property

protected short timerIdCounter
Résultat short