%SYS
Stats Class Reference

<style type="text/css"> DEP { color: red; font-weight: bold; } BC { color: green; font-weight: bold; } PROP { display: block; white-space: pre; font-size: 16px; font-family: monospace; } .dep-head { color: red; white-space: pre; font-family: 'Courier New'; } .section-head { color: blue; white-space: pre; font-family: 'Courier New'; } .info-head { white-space: pre; font-family: 'Courier New'; } </style> More...

Inheritance diagram for Stats:
Collaboration diagram for Stats:

Public Attributes

 CommandsExecuted
 The number of ObjectScript commands that were executed in this Module for the given query. More...
 
 Counter
 This is the number of times the query has been run since the last compile. More...
 
 CursorName
 Placeholder (*) indicating that this is not a Cursor Name for an SQL Statement [Used in SYS.PTools.StatsSQL]. More...
 
 DiskWait
 Number of Milliseconds spent waiting for Disk reads in this Module for the given query. More...
 
 ExeName
 Name of the executable that ran this query. More...
 
 GlobalRefs
 The number globals that were referenced in this Module for the given query. More...
 
 IPAddress
 IP Address of the machine that ran this query. More...
 
 LinesOfCode
 
 MachineName
 Name of the machine that ran this query. More...
 
 ModuleCount
 Number of times we entered this module for the run of the query. More...
 
 ModuleName
 This is the name of the method within a given routine to be analyzed [DEFAULT: 1]. More...
 
 NameSpace
 The NameSpace in which the Stats collection is being invoked. More...
 
 Pid
 OS level Process ID. More...
 
 RoutineInfo
 <PROP> More...
 
 RoutineName
 The name of the routine in which the Stats collection is being invoked. More...
 
 RowCount
 How many rows did the query return for this run. More...
 
 StartTime
 TimeStamp of when the query was compiled/run. More...
 
 StatsGroup
 <PROP> More...
 
 StatsMarker
 <PROP> More...
 
 TimeSpent
 How much time was spent in this Module for the given query. More...
 
 TimeToFirstRow
 How much time was spent finding the first row. More...
 
 TotalTime
 <BC>Maintained for Backward-Compatibility</BC>. More...
 
 UserName
 InterSystems IRIS UserName of the person who ran this query. More...
 
_.Library.String Report (file, conds, ptInfo)
 
 Start (_.Library.String NS, _.Library.String Rou, _.Library.String Mod)
 
 Stop (_.Library.String NS, _.Library.String Rou, _.Library.String Mod)
 
 TriggerOnDelete (timing, ns, rtn, curs, sgrp, mod)
 Perform the OnDelete Trigger operations for this class...
 
_.Library.Integer clearPToolsError (_.Library.String errRowID)
 
_.Library.Status clearStats (_.Library.String ns, _.Library.String rtn, _.Library.Integer ph3, _.Library.Integer clearErrs, _.Library.Integer returnType, _.Library.RawString ptInfo)
 
_.Library.Status clearStatsALL (_.Library.String ns, _.Library.String rtn, _.Library.Integer ph3, _.Library.Integer clearErrs, _.Library.Integer silent, _.Library.Integer returnType, _.Library.RawString ptInfo)
 
_.Library.Status clearStatsAllNS (_.Library.String rtn, _.Library.Integer ph2, _.Library.String ph3, _.Library.Integer clearErrs, _.Library.Integer returnType, _.Library.RawString ptInfo)
 
_.Library.Status clearStatsSQLALL (_.Library.String ns, _.Library.String rtn, _.Library.Integer ph3, _.Library.Integer clearAll, _.Library.Integer clearSQLQuery, _.Library.Integer clearBench, _.Library.Integer clearSQLIndex, _.Library.Integer clearErrs, _.Library.Integer purgeCQ, _.Library.Integer silent, _.Library.Integer returnType, _.Library.RawString ptInfo)
 
_.Library.Status clearStatsSQLIndexALL (_.Library.String ns, _.Library.Integer clearErrs, _.Library.Integer silent, _.Library.Integer returnType, _.Library.RawString ptInfo)
 
_.Library.Status clearStatsSQLIndexNEW (_.Library.String ns, _.Library.Integer clearErrs, _.Library.Integer silent, _.Library.Integer returnType, _.Library.RawString ptInfo)
 
_.Library.Status clearStatsSQLIndexOLD (_.Library.String ns, _.Library.Integer clearErrs, _.Library.Integer silent, _.Library.Integer returnType, _.Library.RawString ptInfo)
 
_.Library.Status clearStatsSQLNEW (_.Library.String ns, _.Library.String rtn, _.Library.Integer ph3, _.Library.Integer clearAll, _.Library.Integer clearSQLIndex, _.Library.Integer clearErrs, _.Library.Integer purgeCQ, _.Library.Integer silent, _.Library.Integer returnType, _.Library.RawString ptInfo)
 
_.Library.Status clearStatsSQLOLD (_.Library.String ns, _.Library.String rtn, _.Library.Integer ph3, _.Library.Integer clearSQLQuery, _.Library.Integer clearBench, _.Library.Integer clearSQLIndex, _.Library.Integer clearErrs, _.Library.Integer purgeCQ, _.Library.Integer silent, _.Library.Integer returnType, _.Library.RawString ptInfo)
 
_.Library.Status exportStats (file, format, silent, statsType, rtnName, modName, _.Library.RawString conds, _.Library.RawString ptInfo, bcFlag)
 
_.Library.Integer getPToolsError (_.Library.String errRowID, _.Library.RawString PToolsErr)
 
_.Library.String version ()
 Provide the current version for the SYS.PTools.Stats class/section of the Performance Tools (PTools) Application.
 
def __init__ (self)
 *** DEPRECATED via MRP1300 as of 05/30/2022 *** More...
 

Additional Inherited Members

- Static Public Member Functions inherited from FileCreation
 CSVtabHead (metadata, delim)
 CSV Table Header.
 
 CSVtabRow (metadata, delim)
 CSV Table Data Row.
 
 DLMtabHead (metadata, delim)
 DLM Table Header.
 
 DLMtabRow (metadata, delim)
 DLM Table Data Row.
 
 HTMLtabHead (aTag, title, metadata)
 HTML Table Header.
 
 HTMLtabRow (metadata)
 HTML Table Row.
 
 TXTtabHead (metadata, delim)
 Text Table Header.
 
 TXTtabRow (metadata, delim)
 Text Table Data Row.
 
 XMLcolAuto ()
 XML Column AutoFit Width Element.
 
 XMLcolWidth (width)
 XML Column Width Element.
 
 XMLrowHeader (metadata)
 XML Header Row Element.
 
 XMLsheet (name)
 XML Worksheet Element.
 
 XMLsort (sortColList, sortOrderList)
 XML Sorting Element.
 
 XMLtabRow (metadata)
 XML Table Data Row Element.
 
 XMLtable (colCnt, rowCnt)
 XML Table Element.
 
_.Library.Status condsMatch (conds, d, condValExp)
 Check Conditional Matches.
 
_.Library.Status createAndOpenFile (file, timeout)
 Create & Open File.
 
_.Library.String createOrderByList (orderBy, d)
 Create a valid SQL <order-by-list>
 
 fileBody (file, format, metadata)
 File Body.
 
_.Library.Status fileFooter (file, format, footerMsg, metadata, elapseTime, rowCnt)
 File Footer.
 
_.Library.Status fileHeader (file, format, title, class, method, version, metadata, bcFlag)
 File Header.
 
_.Library.String getOutputFile (file, className, methodName, format, hDate, tSC)
 Get the 'outputFile'.
 
_.Library.Status openFileForRead (file, timeout)
 Open File For Read.
 

Detailed Description

<style type="text/css"> DEP { color: red; font-weight: bold; } BC { color: green; font-weight: bold; } PROP { display: block; white-space: pre; font-size: 16px; font-family: monospace; } .dep-head { color: red; white-space: pre; font-family: 'Courier New'; } .section-head { color: blue; white-space: pre; font-family: 'Courier New'; } .info-head { white-space: pre; font-family: 'Courier New'; } </style>

Class: SYS.PTools.Stats Replaces: N/A Purpose:
This class is designed to gather performance statistics for any type of routine or code block.

The data for this class is stored in the following optimized global: ^sqlcq($NAMESPACE,"PTools","db","Stats{C|D|I|S|Z}")

By calling pairs of the Start() and Stop() methods we will record GlobalRef, commands executed, TimeSpent, and some additional 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:

NS - The namespace in which the stats collection is occurring Rou - The routine name for which the stats collection is occurring Mod - The module name for which the stats collection is occurring [DEFAULT: 1]

For example, when the following code is executed, the three entries will be recorded into the SYS_PTools.Stats table, one for each call to Stop().

Test ; new ns set ns=$NAMESPACE if ns'="SAMPLES" new $NAMESPACE set $NAMESPACE="SAMPLES" // Change to 'SAMPLES' NS

do ##class(SYS.PTools.Stats).Start($NAMESPACE,"Test","Full_Module") do ##class(SYS.PTools.Stats).Start($NAMESPACE,"Test","Populate")

do ##class(Sample.Person).Populate(100)

do ##class(SYS.PTools.Stats).Stop($NAMESPACE,"Test","Populate") do ##class(SYS.PTools.Stats).Start($NAMESPACE,"Test","PrintPersons")

do ##class(Sample.Person).PrintPersons()

do ##class(SYS.PTools.Stats).Stop($NAMESPACE,"Test","PrintPersons") do ##class(SYS.PTools.Stats).Stop($NAMESPACE,"Test","Full_Module") QUIT

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

*** DEPRECATED via MRP1300 as of 05/30/2022 ***

The 'LinesOfCode' property has been deprecated and replaced by the 'CommandsExecuted' property, but is left here for backwards compatibility and returns the 'CommandsExecuted' value. At some point in the future this property will be removed from the product, so users should not rely on its availability going forward and should use the 'CommandsExecuted' property instead.  

Reimplemented in StatsSQL, and SQLStats.

Member Function Documentation

◆ Report()

_.Library.String Report (   file,
  conds,
  ptInfo 
)
static

Method: Report [SQL: Stats_Report] Replaces: N/A Status: <BC>Maintained for Backward-Compatibility</BC>. See exportStats(...) <DEP>[DEPRECATED]</DEP> Purpose: This method generates a comma delimited file containing the data from the 'SYS.PTools.Stats' class By default the file will be created in the MGR directory of the InterSystems IRIS instance. You can pass a different value for the 'file' parameters if you wish to override the default location and file name.

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).Report(...) SQL: CALL SYS_PTools.Stats_Report(...) SELECT SYS_PTools.Stats_Report(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does.

Examples: The following examples shows the use of this method:

#1 Display this export file to the screen via a InterSystems IRIS Terminal:

       set io=##class(%SYS.PTools.Stats).Report($IO)

#2 Display this export file via the SQL Query Page of the Management Portal:

CALL SYS_PTools.Stats_Report('$IO')

Where: '$IO' = Output to the current device NOTE: '$IO' can be omitted, as it is the default 'file' when invoked via the CALL interface

Data Storage: ^sqlcq($NAMESPACE,"PTools","db","Stats{C|D|I|S|Z}")

Parameters: file - The path and file in which to create and store the data from the SYS.PTools.Stats class: (e.g. C:\exportFile.txt) NOTE: $IO = Outputs the data to the screen '$IO' = Output the data to the current device when invoked from the CALL/SELECT-interface '$DEF' = Ouput the data to the DEFAULT file when invoked from the CALL/SELECT-interface [DEFAULT: {MGR-Directory}computerName}_{ConfigName}_YYYYMMDD_HHMMSS.Stats] conds - A string/array of possible conditions by which to restrict the output of the Export file, in the following format:

conds=<full condition> OR conds(0)=pos Count (WHERE pos = {1...n}) conds(pos)=$LIST() Pieces: 1) [<logical operator>] (Assumed Default: &&) 2) [{Heading}] (Omit for override cond) 3) <simple condition> | <complex condition>

WHERE: <full condition> := <full condition expression> <logical operator> := {&& | ||} (&& = AND | || = OR) <simple condition>@* := <oper>

<complex condition>@ := <complex condition expression>

@ = Contains no references to {Heading}

  • = Contains no references to {*}

EXAMPLE: <full condition> conds="("",INFO,MAIN,""[("",""_{Module}_"",""))||({GlobalRefs}>20)" <simple condition> conds(0)=3 conds(1)=$LB(,"Module","=""INFO""") conds(2)=$LB("||","Module","=""MAIN""") conds(3)=$LB("||","GlobalRefs",">20") <complex condition> conds(0)=2 conds(1)=$LB(,"Module",""",INFO,MAIN,""[("",""_{*}_"","")") conds(2)=$LB("||","GlobalRefs","{*}>20") WHERE: {*} = value substitution for the 'Module' & 'GlobalRefs' fields NOTE: Conditions that don't contain any references to {Heading} fields, often called <override condition>s, can be included as <complex condition>s, as in the following example: conds(pos)=$LB(,,"$g(^zAction(""runIt""))=1")

NOTE: All conditions must be satisfied for the conds() to be considered true and for the row to be exported [PASS BY REFERENCE] ptInfo - A Pass By Reference information array that returns to the user the following details: ptInfo(variable)=value ptInfo("outputFile")=The canonical name of the Export/Reporting file

RETURN Value: The output locations of the exported data; Otherwise, return the error status if one occurred

◆ Start()

Start ( _.Library.String  NS,
_.Library.String  Rou,
_.Library.String  Mod 
)
static

Method: Start Replaces: N/A Status: Original Functionality Purpose: This method is used to START the PTools statistics collection

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).Start(...) SQL: N/A

Examples: The following examples shows the use of this method:

#1 Start collecting stats to analyze the class 'Populate' method:

       do ##class(%SYS.PTools.Stats).Start($NAMESPACE,"Test","Populate")
       do ##class(Sample.Person).Populate(100)
       do ##class(%SYS.PTools.Stats).Stop($NAMESPACE,"Test","Populate")

Data Storage: ^sqlcq($NAMESPACE,"PTools","db","Stats{C|D|I|S|Z}")

Parameters: NS - The namespace in which the stats collection is occurring Rou - The routine name for which the stats collection is occurring Mod - The module name for which the stats collection is occurring [DEFAULT: 1]

RETURN Value: (NONE)

◆ Stop()

Stop ( _.Library.String  NS,
_.Library.String  Rou,
_.Library.String  Mod 
)
static

Method: Stop Replaces: N/A Status: Original Functionality Purpose: This method is used to STOP the PTools statistics collection This method INSERTs the stats information into the SYS_PTools.Stats table

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).Stop(...) SQL: N/A

Examples: The following examples shows the use of this method:

#1 Stop collecting stats to analyze the class 'Populate' method:

       do ##class(%SYS.PTools.Stats).Start($NAMESPACE,"Test","Populate")
       do ##class(Sample.Person).Populate(100)
       do ##class(%SYS.PTools.Stats).Stop($NAMESPACE,"Test","Populate")

Data Storage: ^sqlcq($NAMESPACE,"PTools","db","Stats{C|D|I|S|Z}")

Parameters: NS - The namespace in which the stats collection is occurring Rou - The routine name for which the stats collection is occurring Mod - The module name for which the stats collection is occurring

RETURN Value: (NONE)

◆ clearPToolsError()

_.Library.Integer clearPToolsError ( _.Library.String  errRowID)
static

Method: clearPToolsError [SQL: PT_clearPToolsError] Replaces: N/A Status: New Functionality Purpose: This method deletes a specific 'PTools' Application Error for the given 'errRowID' or Deletes all errors if no 'errRowID' is provided.

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).clearPToolsError(...) SQL: SELECT SYS_PTools.PT_clearPToolsError(...)

Data Storage: ^sqlcq($NAMESPACE,"PTools","Error",{errRowID})

Parameters: errRowID - The 'PTools' Error RowID to delete; If none specified, then delete all recorded PTools errors

RETURN Value: The 'PTools' Error RowID ({errRowID}) deleted, the empty string ("") if {errRowID} invalid, or the word 'all' indicating an array of all errors deleted.

◆ clearStats()

_.Library.Status clearStats ( _.Library.String  ns,
_.Library.String  rtn,
_.Library.Integer  ph3,
_.Library.Integer  clearErrs,
_.Library.Integer  returnType,
_.Library.RawString  ptInfo 
)
static

Method: clearStats [SQL: PT_clearStats] Replaces: N/A Status: New Functionality Purpose: This method deletes all of the data stored in the 'SYS.PTools.Stats' class, based on the specified 'ns' and 'rtn' parameters...

This method clears statistics which are gathered by the invocation of the following two methods: do ##class(SYS.PTools.Stats).Start(NS,Rou,Mod) // Start Stats Collection // Invoke the method in which statistics are to be collected do ##class(SYS.PTools.Stats).Stop(NS,Rou,Mod) // Stop Stats Collection

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).clearStats(...) SQL: CALL SYS_PTools.PT_clearStats(...) SELECT SYS_PTools.PT_clearStats(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does.

Data Storage: ^sqlcq($NAMESPACE,"PTools","db","Stats{C|D|I|S|Z}")

Parameters: ns - The namespace in which to clear Statistics If none provided, use the current namespaces where Stats collected [DEFAULT: Current Namespace] rtn - The routine for which to clear Statistics If none provided, clear all routines in the given 'ns' [OPTIONAL] ph3 - Placeholder Parameter for future extensibility clearErrs - 0 = Don't delete the 'PTools' Application Errors 1 = Delete all of the 'PTools' Application Errors [DEFAULT: 0] returnType - 0 = Return a Status code of either $$$OK or $$$ERROR() 1 = Return the number of Stats rows deleted from the following class: SYS.PTools.Stats [DEFAULT: 0] ptInfo - A Pass By Reference information array that returns detailed information to the user in the following format: ptInfo(category,variable)=value OR $LB(val1,...,valn) Where category = { "cnt" | "curr" | "term" | ... } variable = A var corresponding to the given 'category'

Example: ptInfo("cnt","clearStats")=The number of rows deleted via this method

RETURN Value: Based on the value of the 'returnType' parameter, return one of the following: 0: Return a Status code of either $$$OK or $$$ERROR()

1: Return the number of Stats rows deleted from the following class; Otherwise, return an error message if an error occurred: SYS.PTools.Stats

◆ clearStatsALL()

_.Library.Status clearStatsALL ( _.Library.String  ns,
_.Library.String  rtn,
_.Library.Integer  ph3,
_.Library.Integer  clearErrs,
_.Library.Integer  silent,
_.Library.Integer  returnType,
_.Library.RawString  ptInfo 
)
static

<b> C L E A R 'Stats' D A T A </b>

The following methods are used to remove all of the 'Stats' data:

The aforementioned methods remove data stored in the following classes:

  • SYS.PTools.Stats (old/new)

NOTE: old = Backward-compatible data

Method: clearStatsALL [SQL: PT_clearStatsALL] Replaces: N/A Status: New Functionality Purpose: This method deletes all of the data stored in the Original (backward-compatible) and the Optimal (new) PTools Stats class (SYS.PTools.Stats), based on the specified parameters...

NOTE: Clear ALL PTools Stats data: OLD & NEW (By Default)

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).clearStatsALL(...) ..clearStatsALL(...) SQL: CALL SYS_PTools.PT_clearStatsALL(...) SELECT SYS_PTools.PT_clearStatsALL(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does.

Data Storage: ^sqlcq($NAMESPACE,"PTools","db","Stats{C|D|I|S|Z}")

Parameters: ns - The namespace in which to clear PTools Stats [DEFAULT: $NAMESPACE] rtn - The routine in which to clear PTools SQL Statistics [DEFAULT: ""] If none provided, clear all routines in the given 'ns' ph3 - Placeholder Parameter for future extensibility clearErrs - 0 = Don't delete the 'PTools' Application Errors 1 = Delete all of the 'PTools' Application Errors [DEFAULT] silent - 0 = Display all messages during this method invocation [DEFAULT] 1 = Don't display any messages during this method invocation returnType - 0 = Return a Status code of either $$$OK or $$$ERROR() [DEFAULT] 1 = Return the total number of Stats rows deleted ptInfo - A Pass By Reference information array that returns detailed information to the user in the following format: ptInfo(category,variable)=value OR $LB(val1,...,valn) Where category = { "cnt" | "curr" | "term" | ... } variable = A var corresponding to the given 'category'

Example: ptInfo("cnt","clearStatsALL")=The number of rows deleted via this method

RETURN Value: Based on the value of the 'returnType' parameter, return one of the following: 0: Return a Status code of either $$$OK or $$$ERROR()

1: Return the total number of Stats rows deleted; Otherwise, return an error message if an error occurred

◆ clearStatsAllNS()

_.Library.Status clearStatsAllNS ( _.Library.String  rtn,
_.Library.Integer  ph2,
_.Library.String  ph3,
_.Library.Integer  clearErrs,
_.Library.Integer  returnType,
_.Library.RawString  ptInfo 
)
static

Method: clearStatsAllNS [SQL: PT_clearStatsAllNS] Replaces: N/A Status: New Functionality Purpose: This method deletes all of the data stored in the 'SYS.PTools.Stats' class in All Namespaces on a system for which the user has Write privileges (Write infers Read), based on the optional 'rtn' parameter.

This method clears statistics in all namespaces which are gathered by the invocation of the following two methods: do ##class(SYS.PTools.Stats).Start(NS,Rou,Mod) // Start Stats Collection // Invoke the method in which statistics are to be collected do ##class(SYS.PTools.Stats).Stop(NS,Rou,Mod) // Stop Stats Collection

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).clearStatsAllNS(...) SQL: CALL SYS_PTools.PT_clearStatsAllNS(...) SELECT SYS_PTools.PT_clearStatsAllNS(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does.

Data Storage: ^sqlcq($NAMESPACE,"PTools","db","Stats{C|D|I|S|Z}")

Parameters: rtn - The routine in which to clear SQL Statistics If none provided, clear all routines in all appropriate namespaces [OPTIONAL] ph2 - Placeholder Parameter for future extensibility ph3 - Placeholder Parameter for future extensibility clearErrs - 0 = Don't delete the 'PTools' Application Errors 1 = Delete all of the 'PTools' Application Errors [DEFAULT: 0] returnType - 0 = Return a Status code of either $$$OK or $$$ERROR() 1 = Return the total number of Stats rows deleted from the following class, for each namespace: SYS.PTools.Stats [DEFAULT: 0] ptInfo - A Pass By Reference information array that returns detailed information to the user in the following format: ptInfo(category,variable)=value OR $LB(val1,...,valn) Where category = { "cnt" | "curr" | "term" | ... } variable = A var corresponding to the given 'category'

Example: ptInfo("cnt","clearStatsAllNS")=The number of rows deleted via this method

RETURN Value: Based on the value of the 'returnType' parameter, return one of the following: 0: Return a Status code of either $$$OK or $$$ERROR()

1: Return the number of Stats rows deleted from the following class; Otherwise, return an error message if an error occurred: SYS.PTools.Stats

◆ clearStatsSQLALL()

_.Library.Status clearStatsSQLALL ( _.Library.String  ns,
_.Library.String  rtn,
_.Library.Integer  ph3,
_.Library.Integer  clearAll,
_.Library.Integer  clearSQLQuery,
_.Library.Integer  clearBench,
_.Library.Integer  clearSQLIndex,
_.Library.Integer  clearErrs,
_.Library.Integer  purgeCQ,
_.Library.Integer  silent,
_.Library.Integer  returnType,
_.Library.RawString  ptInfo 
)
static

<b> C L E A R 'SQL Stats' D A T A </b>

The following methods are used to remove all of the 'SQL Stats' data:

  • clearStatsSQLALL()
    • clearStatsSQLOLD()
      • clearSQLStats() <class>SYS.PTools.SQLStats</class>
      • clearSQLQuery() <class>SYS.PTools.SQLQuery</class>
      • clearSQLBenchMarkQry() <class>SYS.PTools.SQLBenchMarkQueries</class>
      • clearSQLBenchMarkRslt() <class>SYS.PTools.SQLBenchMarkResults</class>
    • clearStatsSQLNEW()
      • clearStatsSQL() <class>SYS.PTools.StatsSQL</class>
      • clearStatsSQLAllNS() <class>SYS.PTools.StatsSQL</class>

The aforementioned methods remove data stored in the following classes:

  • SYS.PTools.SQLStats (old)
  • SYS.PTools.SQLQuery (old)
  • SYS.PTools.SQLBenchMarkQueries (old)
  • SYS.PTools.SQLBenchMarkResults (old)
  • SYS.PTools.StatsSQL (new)

Optional:

  • SYS.PTools.SQLUtilities (old)
  • SYS.PTools.SQLUtilResults (old)
  • SYS.PTools.UtilSQLStatements (new)
  • SYS.PTools.UtilSQLAnalysisDB (new)

NOTE: old = Backward-compatible data

Method: clearStatsSQLALL [SQL: PT_clearStatsSQLALL] Replaces: N/A Status: New Functionality Purpose: This method deletes all of the data stored in the Original (backward-compatible) and the Optimal (new) PTools SQL Stats classes, based on the specified parameters...

NOTE: Clear ALL PTools SQL Stats data: OLD & NEW (By Default)

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).clearStatsSQLALL(...) ..clearStatsSQLALL(...) SQL: CALL SYS_PTools.PT_clearStatsSQLALL(...) SELECT SYS_PTools.PT_clearStatsSQLALL(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does. Since this method returns a $LIST() of Status codes, the output can be converted to a comma-delimited string by using the $LISTTOSTRING(...) function on the ObjectScript or SQL result.

Data Storage: ^sqlcq($NAMESPACE,"PTools",...)

PARAMETERS: ns - The namespace in which to clear PTools SQL Statistics [DEFAULT: $NAMESPACE] rtn - The routine in which to clear PTools SQL Statistics [DEFAULT: ""] If none provided, clear all routines in the given 'ns' ph3 - Placeholder Parameter for future extensibility clearAll - 0 = Delete all of the data, except the 'INFO' rows, stored in the StatsSQL class:

  • SYS.PTools.StatsSQL (new) 1 = Delete all of the data, including the 'INFO' rows, [DEFAULT] stored in the StatsSQL class:
  • SYS.PTools.StatsSQL (new) clearSQLQuery - 0 = Don't delete the data stored in the SQLQuery class:
  • SYS.PTools.SQLQuery (old) 1 = Delete all of the data stored in the SQLQuery class: [DEFAULT]
  • SYS.PTools.SQLQuery (old) clearBench - 0 = Don't delete the data stored in the SQLBenchmark class:
  • SYS.PTools.SQLBenchMarkQueries (old) 1 = Delete all of the data stored in the SQLBenchmark class: [DEFAULT]
  • SYS.PTools.SQLBenchMarkQueries (old) clearSQLIndex - 0 = Don't delete the data stored in the Utility SQL [DEFAULT] Index/Analysis classes:
  • SYS.PTools.SQLUtilities (old)
  • SYS.PTools.SQLUtilResults (old)
  • SYS.PTools.UtilSQLStatements (new)
  • SYS.PTools.UtilSQLAnalysisDB (new) 1 = Delete all of the data stored in the Utility SQL Index/Analysis classes:
  • SYS.PTools.SQLUtilities (old)
  • SYS.PTools.SQLUtilResults (old)
  • SYS.PTools.UtilSQLStatements (new)
  • SYS.PTools.UtilSQLAnalysisDB (new) clearErrs - 0 = Don't delete the 'PTools' Application Errors 1 = Delete all of the 'PTools' Application Errors [DEFAULT] purgeCQ - 0 = Don't purge all of the Cached Queries [DEFAULT] 1 = Purge all of the Cached Queries silent - 0 = Display all messages during this method invocation [DEFAULT] 1 = Don't display any messages during this method invocation returnType - 0 = Return a Status code of either $$$OK or $$$ERROR() [DEFAULT] 1 = Return the total number of Stats rows deleted ptInfo - A Pass By Reference information array that returns detailed information to the user in the following format: ptInfo(category,variable)=value OR $LB(val1,...,valn) Where category = { "cnt" | "curr" | "term" | ... } variable = A var corresponding to the given 'category'

Example: ptInfo("cnt","clearStatsSQLALL")=The number of rows deleted via this method

NOTE: old = Backward-compatible data

RETURN Value: Based on the value of the 'returnType' parameter, return one of the following: 0: Return a Status code of either $$$OK or $$$ERROR()

1: Return the total number of Stats rows deleted; Otherwise, return an error message if an error occurred

◆ clearStatsSQLIndexALL()

_.Library.Status clearStatsSQLIndexALL ( _.Library.String  ns,
_.Library.Integer  clearErrs,
_.Library.Integer  silent,
_.Library.Integer  returnType,
_.Library.RawString  ptInfo 
)
static

<b> C L E A R 'SQL Index Stats' D A T A </b>

The following methods are used to remove all of the 'SQL Index Stats' data:

The aforementioned methods remove data stored in the following classes:

  • SYS.PTools.SQLUtilities (old)
  • SYS.PTools.SQLUtilResults (old)
  • SYS.PTools.UtilSQLStatements (new)
  • SYS.PTools.UtilSQLAnalysisDB (new)

NOTE: old = Backward-compatible data

Method: clearStatsSQLIndexALL [SQL: PT_clearStatsSQLIndexALL] Replaces: N/A Status: New Functionality Purpose: This method deletes all of the data stored in the Original (backward-compatible) and the Optimal (new) PTools Utility SQL Index/Analysis Stats classes, based on the specified parameters...

NOTE: Clear ALL PTools Utility SQL Index/Analysis Stats: OLD & NEW (By Default)

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).clearStatsSQLIndexALL(...) ..clearStatsSQLIndexALL(...) SQL: CALL SYS_PTools.PT_clearStatsSQLIndexALL(...) SELECT SYS_PTools.PT_clearStatsSQLIndexALL(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does. Since this method returns a $LIST() of Status codes, the output can be converted to a comma-delimited string by using the $LISTTOSTRING(...) function on the ObjectScript or SQL result.

Data Storage: ^sqlcq($NAMESPACE,"PTools",...)

PARAMETERS: ns - The namespace in which to clear PTools Stats [DEFAULT: $NAMESPACE] clearErrs - 0 = Don't delete the 'PTools' Application Errors 1 = Delete all of the 'PTools' Application Errors [DEFAULT] silent - 0 = Display all messages during this method invocation [DEFAULT] 1 = Don't display any messages during this method invocation returnType - 0 = Return a Status code of either $$$OK or $$$ERROR() [DEFAULT] 1 = Return the total number of Stats rows deleted ptInfo - A Pass By Reference information array that returns detailed information to the user in the following format: ptInfo(category,variable)=value OR $LB(val1,...,valn) Where category = { "cnt" | "curr" | "term" | ... } variable = A var corresponding to the given 'category'

Example: ptInfo("cnt","clearStatsSQLIndexALL")=The number of rows deleted via this method

RETURN Value: Based on the value of the 'returnType' parameter, return one of the following: 0: Return a Status code of either $$$OK or $$$ERROR()

1: Return the total number of Stats rows deleted; Otherwise, return an error message if an error occurred

◆ clearStatsSQLIndexNEW()

_.Library.Status clearStatsSQLIndexNEW ( _.Library.String  ns,
_.Library.Integer  clearErrs,
_.Library.Integer  silent,
_.Library.Integer  returnType,
_.Library.RawString  ptInfo 
)
static

Method: clearStatsSQLIndexNEW [SQL: PT_clearStatsSQLIndexNEW] Replaces: N/A Status: New Functionality Purpose: This method deletes all of the data stored in the Optimal (new) PTools Utility SQL Index/Analysis Stats classes, based on the specified parameters...

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).clearStatsSQLIndexNEW(...) ..clearStatsSQLIndexNEW(...) SQL: CALL SYS_PTools.PT_clearStatsSQLIndexNEW(...) SELECT SYS_PTools.PT_clearStatsSQLIndexNEW(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does.

Data Storage: ^sqlcq($NAMESPACE,"PTools",...)

PARAMETERS: ns - The namespace in which to clear PTools Stats [DEFAULT: $NAMESPACE] clearErrs - 0 = Don't delete the 'PTools' Application Errors 1 = Delete all of the 'PTools' Application Errors [DEFAULT] silent - 0 = Display all messages during this method invocation [DEFAULT] 1 = Don't display any messages during this method invocation returnType - 0 = Return a Status code of either $$$OK or $$$ERROR() [DEFAULT] 1 = Return the total number of Stats rows deleted ptInfo - A Pass By Reference information array that returns detailed information to the user in the following format: ptInfo(category,variable)=value OR $LB(val1,...,valn) Where category = { "cnt" | "curr" | "term" | ... } variable = A var corresponding to the given 'category'

Example: ptInfo("cnt","clearStatsSQLIndexNEW")=The number of rows deleted via this method

RETURN Value: Based on the value of the 'returnType' parameter, return one of the following: 0: Return a Status code of either $$$OK or $$$ERROR()

1: Return the total number of Stats rows deleted; Otherwise, return an error message if an error occurred

◆ clearStatsSQLIndexOLD()

_.Library.Status clearStatsSQLIndexOLD ( _.Library.String  ns,
_.Library.Integer  clearErrs,
_.Library.Integer  silent,
_.Library.Integer  returnType,
_.Library.RawString  ptInfo 
)
static

Method: clearStatsSQLIndexOLD [SQL: PT_clearStatsSQLIndexOLD] Replaces: N/A Status: New Functionality Purpose: This method deletes all of the data stored in the Original (backward-compatible) PTools Utility SQL Index/Analysis Stats classes, based on the specified parameters...

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).clearStatsSQLIndexOLD(...) ..clearStatsSQLIndexOLD(...) SQL: CALL SYS_PTools.PT_clearStatsSQLIndexOLD(...) SELECT SYS_PTools.PT_clearStatsSQLIndexOLD(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does.

Data Storage: ^sqlcq($NAMESPACE,"PTools",...)

PARAMETERS: ns - The namespace in which to clear PTools Stats [DEFAULT: $NAMESPACE] clearErrs - 0 = Don't delete the 'PTools' Application Errors 1 = Delete all of the 'PTools' Application Errors [DEFAULT] silent - 0 = Display all messages during this method invocation [DEFAULT] 1 = Don't display any messages during this method invocation returnType - 0 = Return a Status code of either $$$OK or $$$ERROR() [DEFAULT] 1 = Return the total number of Stats rows deleted ptInfo - A Pass By Reference information array that returns detailed information to the user in the following format: ptInfo(category,variable)=value OR $LB(val1,...,valn) Where category = { "cnt" | "curr" | "term" | ... } variable = A var corresponding to the given 'category'

Example: ptInfo("cnt","clearStatsSQLIndexOLD")=The number of rows deleted via this method

RETURN Value: Based on the value of the 'returnType' parameter, return one of the following: 0: Return a Status code of either $$$OK or $$$ERROR()

1: Return the total number of Stats rows deleted; Otherwise, return an error message if an error occurred

◆ clearStatsSQLNEW()

_.Library.Status clearStatsSQLNEW ( _.Library.String  ns,
_.Library.String  rtn,
_.Library.Integer  ph3,
_.Library.Integer  clearAll,
_.Library.Integer  clearSQLIndex,
_.Library.Integer  clearErrs,
_.Library.Integer  purgeCQ,
_.Library.Integer  silent,
_.Library.Integer  returnType,
_.Library.RawString  ptInfo 
)
static

Method: clearStatsSQLNEW [SQL: PT_clearStatsSQLNEW] Replaces: N/A Status: New Functionality Purpose: This method deletes all of the data stored in the Optimal (new) PTools SQL Stats classes, based on the specified parameters...

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).clearStatsSQLNEW(...) ..clearStatsSQLNEW(...) SQL: CALL SYS_PTools.PT_clearStatsSQLNEW(...) SELECT SYS_PTools.PT_clearStatsSQLNEW(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does.

Data Storage: ^sqlcq($NAMESPACE,"PTools",...)

PARAMETERS: ns - The namespace in which to clear PTools SQL Statistics [DEFAULT: $NAMESPACE] rtn - The routine in which to clear PTools SQL Statistics [DEFAULT: ""] If none provided, clear all routines in the given 'ns' ph3 - Placeholder Parameter for future extensibility clearAll - 0 = Delete all of the data, except the 'INFO' rows, stored in the StatsSQL class:

  • SYS.PTools.StatsSQL (new) 1 = Delete all of the data, including the 'INFO' rows, [DEFAULT] stored in the StatsSQL class:
  • SYS.PTools.StatsSQL (new) clearSQLIndex - 0 = Don't delete the data stored in the Utility SQL [DEFAULT] Index/Analysis classes:
  • SYS.PTools.UtilSQLStatements (new)
  • SYS.PTools.UtilSQLAnalysisDB (new) 1 = Delete all of the data stored in the Utility SQL Index/Analysis classes:
  • SYS.PTools.UtilSQLStatements (new)
  • SYS.PTools.UtilSQLAnalysisDB (new) clearErrs - 0 = Don't delete the 'PTools' Application Errors 1 = Delete all of the 'PTools' Application Errors [DEFAULT] purgeCQ - 0 = Don't purge all of the Cached Queries [DEFAULT] 1 = Purge all of the Cached Queries silent - 0 = Display all messages during this method invocation [DEFAULT] 1 = Don't display any messages during this method invocation returnType - 0 = Return a Status code of either $$$OK or $$$ERROR() [DEFAULT] 1 = Return the total number of Stats rows deleted ptInfo - A Pass By Reference information array that returns detailed information to the user in the following format: ptInfo(category,variable)=value OR $LB(val1,...,valn) Where category = { "cnt" | "curr" | "term" | ... } variable = A var corresponding to the given 'category'

Example: ptInfo("cnt","clearStatsSQLNEW")=The number of rows deleted via this method

RETURN Value: Based on the value of the 'returnType' parameter, return one of the following: 0: Return a Status code of either $$$OK or $$$ERROR()

1: Return the total number of Stats rows deleted; Otherwise, return an error message if an error occurred

◆ clearStatsSQLOLD()

_.Library.Status clearStatsSQLOLD ( _.Library.String  ns,
_.Library.String  rtn,
_.Library.Integer  ph3,
_.Library.Integer  clearSQLQuery,
_.Library.Integer  clearBench,
_.Library.Integer  clearSQLIndex,
_.Library.Integer  clearErrs,
_.Library.Integer  purgeCQ,
_.Library.Integer  silent,
_.Library.Integer  returnType,
_.Library.RawString  ptInfo 
)
static

Method: clearStatsSQLOLD [SQL: PT_clearStatsSQLOLD] Replaces: N/A Status: New Functionality Purpose: This method deletes all of the data stored in the Original (backward-compatible) PTools SQL Stats classes, based on the specified parameters...

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).clearStatsSQLOLD(...) ..clearStatsSQLOLD(...) SQL: CALL SYS_PTools.PT_clearStatsSQLOLD(...) SELECT SYS_PTools.PT_clearStatsSQLOLD(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does.

Data Storage: ^sqlcq($NAMESPACE,"PTools",...)

PARAMETERS: ns - The namespace in which to clear PTools SQL Statistics [DEFAULT: $NAMESPACE] rtn - The routine in which to clear PTools SQL Statistics [DEFAULT: ""] If none provided, clear all routines in the given 'ns' ph3 - Placeholder Parameter for future extensibility clearSQLQuery - 0 = Don't delete the data stored in the SQLQuery class:

  • SYS.PTools.SQLQuery (old) 1 = Delete all of the data stored in the SQLQuery class: [DEFAULT]
  • SYS.PTools.SQLQuery (old) clearBench - 0 = Don't delete the data stored in the SQLBenchmark class:
  • SYS.PTools.SQLBenchMarkQueries (old) 1 = Delete all of the data stored in the SQLBenchmark class: [DEFAULT]
  • SYS.PTools.SQLBenchMarkQueries (old) clearSQLIndex - 0 = Don't delete the data stored in the Utility SQL [DEFAULT] Index/Analysis classes:
  • SYS.PTools.SQLUtilities (old)
  • SYS.PTools.SQLUtilResults (old) 1 = Delete all of the data stored in the Utility SQL Index Analysis classes:
  • SYS.PTools.SQLUtilities (old)
  • SYS.PTools.SQLUtilResults (old) clearErrs - 0 = Don't delete the 'PTools' Application Errors 1 = Delete all of the 'PTools' Application Errors [DEFAULT] purgeCQ - 0 = Don't purge all of the Cached Queries [DEFAULT] 1 = Purge all of the Cached Queries silent - 0 = Display all messages during this method invocation [DEFAULT] 1 = Don't display any messages during this method invocation returnType - 0 = Return a Status code of either $$$OK or $$$ERROR() [DEFAULT] 1 = Return the total number of Stats rows deleted ptInfo - A Pass By Reference information array that returns detailed information to the user in the following format: ptInfo(category,variable)=value OR $LB(val1,...,valn) Where category = { "cnt" | "curr" | "term" | ... } variable = A var corresponding to the given 'category'

Example: ptInfo("cnt","clearStatsSQLOLD")=The number of rows deleted via this method

RETURN Value: Based on the value of the 'returnType' parameter, return one of the following: 0: Return a Status code of either $$$OK or $$$ERROR()

1: Return the total number of Stats rows deleted; Otherwise, return an error message if an error occurred

◆ exportStats()

_.Library.Status exportStats (   file,
  format,
  silent,
  statsType,
  rtnName,
  modName,
_.Library.RawString  conds,
_.Library.RawString  ptInfo,
  bcFlag 
)
static

Method: exportStats [SQL: PT_exportStats] Replaces: Report <DEP>[DEPRECATED]</DEP> Status: New Method to replicate Backward-Compatible Method it 'Replaces' Purpose: Create a Performance Tool file containing the data from the 'SYS.PTools.Stats' and return the output location... By default, the file will be created in the current directory of the InterSystems IRIS instance.

NOTE: Current directory can be obtained in the following way, from a InterSystems IRIS Terminal: >write $ZU(12,"")

You can pass a different value for the 'file' parameters if you wish to override the default location and file name.

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).exportStats(...) SQL: CALL SYS_PTools.PT_exportStats(...) SELECT SYS_PTools.PT_exportStats(...)

NOTE: This 'SqlProc' method can be invoked with either the CALL-interface or the SELECT-interface. Both interfaces execute the method: the CALL-interface does not return any resulting value, while the SELECT-interface does.

Examples: The following examples shows the use of this method:

#1 Display this export file to the screen via a InterSystems IRIS Terminal:

       set tSC=##class(%SYS.PTools.Stats).exportStats($IO)

#2 Display this export file via the SQL Query Page of the Management Portal:

CALL SYS_PTools.PT_exportStats('$IO','H')

Where: '$IO' = Output to the current device NOTE: '$IO' can be omitted, as it is the default 'file' when invoked via the CALL interface 'H' = Output the format in HTML format NOTE: 'H' can be omitted, as it is the default 'format' when invoked via the CALL interface

Data Storage: ^sqlcq($NAMESPACE,"PTools","db","Stats{C|D|I|S|Z}")

Parameters: file - The path and file in which to create and store the data from the SYS.PTools.Stats class: (e.g. C:\exportFile.txt) NOTE: $IO = Outputs the data to the screen '$IO' = Output the data to the current device when invoked from the CALL/SELECT-interface '$DEF' = Ouput the data to the DEFAULT file when invoked from the CALL/SELECT-interface [DEFAULT: {Current-Directory}\PT_Stats_exportStats_YYYYMMDD_HHMMSS.{ext}] WHERE {Current-Directory} = The directory of the Namespace in which this method is invoked (e.g. $ZU(12,"")) NOTE 2: If Passed By Reference, then 'file' will be returned as the canonical name of the Export/Reporting file format - The output format of the Export/Reporting file This parameter has the following structure of constituent elements: format=<data-format>[:$LB(<delim>,<csv-header>,<csv-footer>)] Where the constituent elements have the following values: <data-format> - The format of the Export/Reporting file:

  • P = Printable/Viewable report file (.txt file, no pagination)
  • D = Comma-delimited data file (.csv file) which can be read into a spreadsheet
  • X = Microsoft Excel XML markup file suitable for import into Excel (.xml file)
  • H = HTML page file (.html file)
  • Z = User-defined delimiter "P" formatted file (.dlm file) NOTE: The <delim> element is required or defaulted to $C(9) (TAB) Optional Elements: <delim> - User-defined delimiter [DEFAULT: $C(9) (TAB)] NOTE: This is generally used for <data-format>="Z" <csv-header> - .csv file header for <data-format>="D":
  • 0 = Don't add non-standard information header to file [DEFAULT]
  • 1 = Add non-standard information header to file <csv-footer> - .csv file footer for <data-format>="D":
  • 0 = Don't add non-standard information footer to file [DEFAULT]
  • 1 = Add non-standard information footer to file EXAMPLES: Valid 'format' values:
  • "H" // HTML file
  • "D" // CSV file with No information header or footer
  • "D:"_$LB(,1,1) // CSV file with information header & footer
  • "Z:"_$LB("^") // User-defined delimiter file (delim="^") silent - 0 - Display all messages during the running of this method 1 - Don't display any messages during the running of this method statsType - 0 - Return all rows from SYS.PTools.Stats ONLY [DEFAULT] 1 - Return all rows from SYS.PTools.StatsSQL ONLY 2 - Return all rows from SYS.PTools.Stats & SYS.PTools.StatsSQL rtnName - If specified, return only the rows where the 'RoutineName' matches the value of this parameter; Otherwise, return rows for all 'RoutineName' values modName - If specified, return only the rows where the 'ModuleName' matches the value of this parameter; Otherwise, return rows for all 'ModuleName' values conds - A string/array of possible conditions by which to restrict the output of the Export file, in the following format:

conds=<full condition> OR conds(0)=pos Count (WHERE pos = {1...n}) conds(pos)=$LIST() Pieces: 1) [<logical operator>] (Assumed Default: &&) 2) [{Heading}] (Omit for override cond) 3) <simple condition> | <complex condition>

WHERE: <full condition> := <full condition expression> <logical operator> := {&& | ||} (&& = AND | || = OR) <simple condition>@* := <oper>

<complex condition>@ := <complex condition expression>

@ = Contains no references to {Heading}

  • = Contains no references to {*}

EXAMPLE: <full condition> conds="("",INFO,MAIN,""[("",""_{Module}_"",""))||({GlobalRefs}>20)" <simple condition> conds(0)=3 conds(1)=$LB(,"Module","=""INFO""") conds(2)=$LB("||","Module","=""MAIN""") conds(3)=$LB("||","GlobalRefs",">20") <complex condition> conds(0)=2 conds(1)=$LB(,"Module",""",INFO,MAIN,""[("",""_{*}_"","")") conds(2)=$LB("||","GlobalRefs","{*}>20") WHERE: {*} = value substitution for the 'Module' & 'GlobalRefs' fields NOTE: Conditions that don't contain any references to {Heading} fields, often called <override condition>s, can be included as <complex condition>s, as in the following example: conds(pos)=$LB(,,"$g(^zAction(""runIt""))=1")

NOTE: All conditions must be satisfied for the conds() to be considered true and for the row to be exported [PASS BY REFERENCE] ptInfo - A Pass By Reference information array that returns to the user the following details: ptInfo(variable)=value ptInfo("outputFile")=The canonical name of the Export/Reporting file bcFlag - This is a Backward-Compatibility flag used for [Internal Purposes ONLY]

RETURN Value: The status from the invocation of this method

◆ getPToolsError()

_.Library.Integer getPToolsError ( _.Library.String  errRowID,
_.Library.RawString  PToolsErr 
)
static

<b> G E T / C L E A R 'PToolsError' D A T A </b>

The following methods are used to retrieve & remove all of the 'PToolsError' data:

The aforementioned methods remove data stored in the following global:

  • ^sqlcq($NAMESPACE,"PTools","Error",{errRowID}) (old/new)

NOTE: old = Backward-compatible data

Method: getPToolsError [SQL: PT_getPToolsError] Replaces: N/A Status: New Functionality Purpose: This method retrieve a specific 'PTools' Application Error for the given 'errRowID' or retrieve all errors if no 'errRowID' is provided.

Invocation: This method can be invoked in the following ways: ObjectScript: ##class(SYS.PTools.Stats).getPToolsError(...) SQL: SELECT SYS_PTools.PT_getPToolsError(...)

NOTE: 'PTools' Application Errors will be returned in the 'PToolsErr' array as follows: PToolsErr={errRowID} [Counter] PToolsErr({errRowID},0)=$LIST:

        1) $HOROLOG                 [Timestamp Internal]
        2) Timestamp External       [Timestamp External: YYYY-MM-DD HH:MM:SS]
        3) $NAMESPACE               [Current Namespace]
        4) $JOB                     [Current $JOB]
        5) $ZN                      [Current Routine]
        6) $zu(41)                  [Stack Level]

PToolsErr({errRowID},1)=$LIST:

        1) {ns}                     [Error Namespace]
        2) {job}                    [Error $JOB]
        3) {rtn}                    [Error Routine]
        4) {curs}                   [Error SQL Cursor]
        5) {mod}                    [Error SQL Module]
        6) {func}                   [Error Function/Method]
        7) {ze}                     [Error $ZE]
        8) {errMsg}                 [Error Message]
                    --- SQL Errors ---
        9) {class}                  [Error Class]
       10) {table}                  [Error Table]
       11) {SQLCODE}                [Error SQLCODE]
       12) {%msg}                   [Error SQL Message]

PToolsErr({errRowID},2)=errLog(errLogID)=errLogMsg PToolsErr({errRowID},2,{errLogID})={errLogMsg}

Parameters: errRowID - The 'PTools' Error RowID to retrieve; If none specified, then retrieve all errors into the 'PToolsErr()' array PToolsErr - An array in which the 'PTools' Application Errors will be returned [PASS BY REFERENCE]

RETURN Value: The 'PTools' Error RowID ({errRowID}) retrieved, the empty string ("") if {errRowID} invalid, or the word 'all' indicating an array of all errors returned.

Member Data Documentation

◆ CommandsExecuted

CommandsExecuted

The number of ObjectScript commands that were executed in this Module for the given query.

The Modules are nested and the count for the outer ones is cumulative  

◆ Counter

Counter

This is the number of times the query has been run since the last compile.

 

◆ CursorName

CursorName

Placeholder (*) indicating that this is not a Cursor Name for an SQL Statement [Used in SYS.PTools.StatsSQL].

 

◆ DiskWait

DiskWait

Number of Milliseconds spent waiting for Disk reads in this Module for the given query.

the Modules are nested and the count for the outer ones is cumulative  

◆ ExeName

ExeName

Name of the executable that ran this query.

 

◆ GlobalRefs

GlobalRefs

The number globals that were referenced in this Module for the given query.

The Modules are nested and the count for the outer ones is cumulative  

◆ IPAddress

IPAddress

IP Address of the machine that ran this query.

 

◆ LinesOfCode

LinesOfCode

◆ MachineName

MachineName

Name of the machine that ran this query.

 

◆ ModuleCount

ModuleCount

Number of times we entered this module for the run of the query.

Used only by Sub class  

◆ ModuleName

This is the name of the method within a given routine to be analyzed [DEFAULT: 1].

This name can be used to distinguish a block of code within a give routine  

◆ NameSpace

NameSpace

The NameSpace in which the Stats collection is being invoked.

 

◆ Pid

Pid

OS level Process ID.

 

◆ RoutineInfo

RoutineInfo

<PROP>

Contains the NameSpace and Routine these stats are for The format is NameSpace|RoutineName

This is not used in the SYS.PTools.SQLStats class </PROP>  

◆ RoutineName

RoutineName

The name of the routine in which the Stats collection is being invoked.

 

◆ RowCount

RowCount

How many rows did the query return for this run.

Used only by Sub class  

◆ StartTime

StartTime

TimeStamp of when the query was compiled/run.

 

◆ StatsGroup

StatsGroup

<PROP>

This is a unique number that specifies the Stats Collection Group for each query run The counter comes from bumping the following global: ^sqlcq($NAMESPACE,"PTools","db","StatsZ","StatsGroup",0,{NameSpace},{RoutineName},{ModuleName}) USE: $$$bumpSYSPToolsStatsGroup({NameSpace},{RoutineName},{ModuleName}) </PROP>  

◆ StatsMarker

StatsMarker

<PROP>

This marker indicates if the statistical data is from an SQL Query, in which case the <class>SYS.PTools.StatsSQL</class> class should be use, or if these stats are general purpose stats for non-SQL modules, in which case the 'SYS.PTools.Stats' class should be use. </PROP>  

◆ TimeSpent

TimeSpent

How much time was spent in this Module for the given query.

the Modules are nested and the count for the outer ones is cumulative  

◆ TimeToFirstRow

TimeToFirstRow

How much time was spent finding the first row.

This is only set for Module Main  

◆ TotalTime

TotalTime

<BC>Maintained for Backward-Compatibility</BC>.

See 'TimeSpent'

 

◆ UserName

UserName

InterSystems IRIS UserName of the person who ran this query.