%SYS.PTools.Stats
persistent class %SYS.PTools.Stats extends %Library.Persistent
SQL Table Name: %SYS_PTools.Stats
This class is designed to gather performance statistics for any type of routine or code block.
The data for this class is stored in ^%SYS.PTools.Stats, ^%SYS.PTools.StatsD and ^%SYS.PTools.StatsI. These globals default to the %SYS NameSpace, you might want to map them to a different NameSpace to avoid filling %SYS.
By calling pairs of the Start() and Stop() methods we will record GlobalRef, commands executed, TotalTime, and some process info for each code block.
You need to manually add the calls to the Start() and Stop() methods to your code.
Each method takes 3 parameters: Namespace - Current namespace the code is being executed in RoutineName - Name of the routine you are gathering stats for ModuleName - Name of the sub block with a given routine, Defaults to 1
For example when the code below is executed we will put three entries into the %SYS_PTools.Stats table, one for each call to Stop().
Test ; DO ##class(%SYS.PTools.Stats).Start("Samples","Test","Full Routine") DO ##class(%SYS.PTools.Stats).Start("Samples","Test","Part 1") DO ##class(Sample.Person).Populate(1000) DO ##class(%SYS.PTools.Stats).Stop("Samples","Test","Part 1") DO ##class(%SYS.PTools.Stats).Start("Samples","Test","Part 2") DO ##class(Sample.Person).PrintPersons() DO ##class(%SYS.PTools.Stats).Stop("Samples","Test","Part 2") DO ##class(%SYS.PTools.Stats).Stop("Samples","Test","Full Routine") QUIT
Property Inventory
- Counter
- DiskWait
- ExeName
- GlobalRefs
- IPAddress
- LinesOfCode
- MachineName
- ModuleCount
- ModuleName
- Pid
- RoutineInfo
- RowCount
- StartTime
- TimeToFirstRow
- TotalTime
- UserName
Method Inventory
Properties
Contains the NameSpace and Routine these stats are for The format is NameSpace|RoutineName This is not used in the %SYS.PTools.SQLStats class
Methods
Indexes
Inherited Members
Inherited Methods
- %AddToSaveSet()
- %AddToSyncSet()
- %BMEBuilt()
- %CheckConstraints()
- %CheckConstraintsForExtent()
- %ClassIsLatestVersion()
- %ClassName()
- %ComposeOid()
- %ConstructClone()
- %Delete()
- %DeleteExtent()
- %DeleteId()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Exists()
- %ExistsId()
- %Extends()
- %GUID()
- %GUIDSet()
- %GetLock()
- %GetParameter()
- %GetSwizzleObject()
- %Id()
- %InsertBatch()
- %IsA()
- %IsModified()
- %IsNull()
- %KillExtent()
- %KillExtentData()
- %LoadFromMemory()
- %LockExtent()
- %LockId()
- %New()
- %NormalizeObject()
- %ObjectIsNull()
- %ObjectModified()
- %Oid()
- %OnBeforeAddToSync()
- %OnDetermineClass()
- %Open()
- %OpenId()
- %OriginalNamespace()
- %PackageName()
- %PhysicalAddress()
- %PurgeIndices()
- %Reload()
- %RemoveFromSaveSet()
- %ResolveConcurrencyConflict()
- %RollBack()
- %Save()
- %SaveDirect()
- %SaveIndices()
- %SerializeObject()
- %SetModified()
- %SortBegin()
- %SortEnd()
- %SyncObjectIn()
- %SyncTransport()
- %UnlockExtent()
- %UnlockId()
- %ValidateIndices()
- %ValidateObject()
Storage
Storage Model: CacheStorage (%SYS.PTools.Stats)
^%SYS.PTools.StatsD(ID) | = | %%CLASSNAME
ModuleName
Counter
RowCount
GlobalRefs
LinesOfCode
TotalTime
StartTime
UserName
IPAddress
MachineName
ExeName
ModuleCount
NameSpace
RoutineInfo
TimeToFirstRow
Pid
DiskWait
|