C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DontDisplayUsecs int
MeterEventsFilename string
MeterLogFilename string

Защищенные свойства (Protected)

Свойство Тип Описание
collecting bool
dumpEventLog bool
instance MeterManager
metersById TimingMeter>.Dictionary
startTime long
timerIdCounter short

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
DebugAddEvent ( TimingMeter meter, MeterEvent evt ) : void

Описание методов

AddEvent() публичный статический метод

public static AddEvent ( TimingMeter meter, short eventKind, string info ) : int
meter TimingMeter
eventKind short
info string
Результат int

AddInfoEvent() публичный статический метод

public static AddInfoEvent ( string info ) : void
info string
Результат void

BarfOnBadChars() защищенный статический метод

protected static BarfOnBadChars ( string name, string nameDescription ) : void
name string
nameDescription string
Результат void

BoolOption() защищенный метод

protected BoolOption ( string name, string>.Dictionary options ) : bool
name string
options string>.Dictionary
Результат bool

CaptureCurrentTime() защищенный статический метод

protected static CaptureCurrentTime ( ) : long
Результат long

ClearEvents() публичный статический метод

public static ClearEvents ( ) : void
Результат void

DumpEventLog() защищенный метод

protected DumpEventLog ( ) : void
Результат void

EnableCategory() публичный статический метод

public static EnableCategory ( string categoryName, bool enable ) : void
categoryName string
enable bool
Результат void

EnableOnlyCategory() публичный статический метод

public static EnableOnlyCategory ( string categoryName, bool enable ) : void
categoryName string
enable bool
Результат void

GenerateReport() защищенный метод

protected GenerateReport ( StreamWriter writer, int start, string>.Dictionary options ) : void
writer System.IO.StreamWriter
start int
options string>.Dictionary
Результат void

GetMeter() публичный статический метод

public static GetMeter ( string title, string category ) : TimingMeter
title string
category string
Результат TimingMeter

GetMeter() публичный статический метод

public static GetMeter ( string title, string category, bool accumulate ) : TimingMeter
title string
category string
accumulate bool
Результат TimingMeter

GetMeterById() защищенный метод

protected GetMeterById ( int id ) : TimingMeter
id int
Результат TimingMeter

IndentCount() защищенный метод

protected IndentCount ( int count ) : string
count int
Результат string

Init() публичный статический метод

public static Init ( ) : void
Результат void

IntOption() защищенный метод

protected IntOption ( string name, string>.Dictionary options ) : int
name string
options string>.Dictionary
Результат int

MeterManager() защищенный метод

protected MeterManager ( ) : System
Результат System

OptionValue() защищенный метод

protected OptionValue ( string name, string>.Dictionary options ) : string
name string
options string>.Dictionary
Результат string

Report() публичный статический метод

public static Report ( string title ) : void
title string
Результат void

Report() публичный статический метод

public static Report ( string title, StreamWriter writer, int start, string optionsString ) : void
title string
writer System.IO.StreamWriter
start int
optionsString string
Результат void

SaveToFile() публичный статический метод

public static SaveToFile ( string pathname ) : void
pathname string
Результат void

SaveToFileInternal() защищенный метод

protected SaveToFileInternal ( string pathname ) : void
pathname string
Результат void

StartTime() публичный статический метод

public static StartTime ( ) : long
Результат long

ToMicroseconds() защищенный метод

protected ToMicroseconds ( long ticks ) : long
ticks long
Результат long

Описание свойств

DontDisplayUsecs публичное статическое свойство

public static int DontDisplayUsecs
Результат int

MeterEventsFilename публичное статическое свойство

public static string MeterEventsFilename
Результат string

MeterLogFilename публичное статическое свойство

public static string MeterLogFilename
Результат string

collecting защищенное свойство

protected bool collecting
Результат bool

dumpEventLog защищенное статическое свойство

protected static bool dumpEventLog
Результат bool

instance защищенное статическое свойство

protected static MeterManager,Axiom.Core instance
Результат MeterManager

metersById защищенное свойство

protected Dictionary metersById
Результат TimingMeter>.Dictionary

startTime защищенное свойство

protected long startTime
Результат long

timerIdCounter защищенное свойство

protected short timerIdCounter
Результат short