%DeepSee.Diagnostic.MDXUtils
Class %DeepSee.Diagnostic.MDXUtils Extends (%XML.Adaptor, %ZEN.DataModel.Adaptor) [ System = 4 ]
This class provides an API for analyzing MDX queries and generating report data. This class is intended for diagnostic purposes only. There is no guarantee made about either the behavior or future operation of this class. Production applications should not make direct use of these APIs.
Files generated are as follows:
- A general statistics report,
- PERFMON samples from running the query both uncached and cached,
- An export of the cube class and fact table. If this cube is a member of a relationship group, all related cube classes will also be exported.
Parameters
VERSION
Parameter VERSION [ Internal ] = "2.1 (January 10, 2014)";
UTILNAME
Parameter UTILNAME [ Internal ] = "MDX Query Performance Analyzer";
Properties
Query
Property Query As %DeepSee.Datatype.string;
MDX Query being analyzed.
ResultsCached
Property ResultsCached As %DeepSee.ResultSet;
DeepSee ResultSet from cached query preparartion (contains statistics).
ResultsUncached
Property ResultsUncached As %DeepSee.ResultSet;
DeepSee ResultSet from uncached query preparation (contains statistics).
lastPrep
Property lastPrep As %Integer [ InitialExpression = -1, Internal ];
Last MDX result set prepared (cached / uncached)
pJob
Property pJob As %Integer [ InitialExpression = 0, Internal ];
PID of current PERFMON background check.
pTime
Property pTime As %Integer [ InitialExpression = 0, Internal ];
Collection period of current PERFMON background check.
UseCache
Property UseCache As %Boolean;
Use cache for statistics - set by %Prep method.
BaseDir
Property BaseDir As %String;
Base directory for analysis output; defaults to install directory.
StartTimes
Property StartTimes As array Of %Numeric;
Holds the start times of the query execution and the start of %Run
CubeGroup
Property CubeGroup As %String [ MultiDimensional ];
This property contains the ordered list of cubes that have some logical relation to the cube currently being queried. The list is ordered from least dependent to most independent.
Verbose
Property Verbose As %Boolean [ InitialExpression = 0 ];
Controls whether or not status updates should be output to the current device.
TrackingOn
Property TrackingOn As %Boolean [ InitialExpression = 0 ];
Used to trigger communication to the UI via the ^DeepSee.MDXUtils global
Methods
Version
ClassMethod Version() As %Status
Prints the current version to the screen
%Run
ClassMethod %Run(pMDX As %String = "", pBaseDir As %String = "", pVerbose As %Boolean = 0, ByRef pParms = "", Output pOutFile = "") As %Status
This method is used for analysis of an MDX query. This runs the query two times; once uncached and once cached. During each of these a PERFMON report will be generated and saved to the destination folder. This utility will also collect and save general query statistics, as well as export the Cube and Fact table definitions.
pMDX - The MDX query to be analyzed
pBaseDir - The base directory for storing the output folder. This is set to the instance installation directory by default.
pVerbose - If true, the analysis will print the long-form output to the current device. Setting pVerbose = 0 will run the analysis completely silently.
There are other options that may be turned on via the pParms array:
pParms("CubeStatsOn") = 1
pParms("TimePERFMON") = 15
pParms("SystemPerformanceOn") = 0
pParms("SystemPerformanceProfile") = ""
pParms("UnattendedOn") = 1
"On" in flag name denotes it is treated as a boolean, "Time" denotes it accepts a positive integer argument, in seconds.
Analyze
Method Analyze(pMDX As %String, pOutFile As %String, pPerfTime As %Integer = 0, pUseCache As %Boolean = 0) As %Status [ Internal ]
Run MDX query analysis.
pMDX - (mandatory) MDX Query to run.
outFile - (mandatory) Output file for PERFMON statistics.
perfTime - PERFMON collection period; any non-zero value will run PERFMON.
UseCache - Use cache for query run (default false).
%Prep
Method %Prep(pMDX As %String = "", pUseCache As %Boolean = 1) As %Status [ Internal ]
Prepare MDX query for execution and set internal variables accordingly.
%Exec
Method %Exec() As %Status [ Internal ]
Execute prepared MDX query; store results accordingly.
PrintQueryStats
Method PrintQueryStats() [ Internal ]
Intended for use in report printing only.
Print statistics of last analyzed query; includes ResultSet statistics.
PrintCubeStats
Method PrintCubeStats(pVerbose As %Boolean = 1) [ Internal ]
Intended for use in report printing only.
Cube Analyze output (to show indices cardinality)
ExportDefinitions
Method ExportDefinitions(pCubeFileName) As %Status [ Internal ]
Export Cube class and Cube fact class to single XML file.
FindSelectivity
Method FindSelectivity() [ Internal ]
Unimplemented.
PrintPlan
Method PrintPlan() [ Internal ]
Intended for use in report printing only.
Pinting method for the query plan
StartPerf
ClassMethod StartPerf(pFile As %String = "", pTime As %Integer = 15) [ Internal ]
Start background PERFMON process; this must be JOBbed off,
and should only be done through the InitPerf() method.
InitPerf
Method InitPerf(pFile As %String = "", pTime As %Integer = 15) As %Status [ Internal ]
Starts PERFMON background process from %Run() context.
This will also affect the ..pJob Property, and a subsequent
call to WaitPerfStop will expect to deal with that PID.
The ..pTime property will also be adjusted to wait an
appropriate amount of time for the last PERFMON run to complete.
WaitPerfStop
Method WaitPerfStop() As %Status [ Internal ]
Wait for current PERFMON to stop; the information regarding that
process' PID and run period will have been set by a successful
InitPerf() earlier.
Lowest timeout threshold is 30 seconds.
SetBaseDir
Method SetBaseDir(pBaseDir As %String = "", pVerbose As %Boolean = 0, pUnattended = 1) As %Status [ Internal ]
Determine the path where the collection data will be stored
PrintDependencies
Method PrintDependencies() As %Status [ Internal ]
Intended for use in report printing only.
Print the dependencies for the cube class and the the DeepSee model
PrintAgentMetrics
Method PrintAgentMetrics() As %Status [ Internal ]
Intended for use in report printing only.
- NOT IMPLEMENTED -
RunSystemPerformance
ClassMethod RunSystemPerformance(pDir, pProfile = "1min") As %Status [ Internal ]
Switches to the %SYS namespace to run SystemPerformance. Best jobbed off?
GetQueryCubeGroup
Method GetQueryCubeGroup(pCube) As %Status [ Internal ]
Find the logical group that this cube belongs to. Information about the group as a whole is needed.
%ClearHistory
ClassMethod %ClearHistory() As %Status
Clear the execution history from the logging global. This will not affect any of the diagnostic reports.
ToHTML
Method ToHTML(ByRef pFileName As %String, pCubeStats As %Boolean, pStatus As %Status = 1) As %Status [ Internal ]
Genenrate MDX Analysis as HTML file.
%OnNew
Method %OnNew(pMDX As %String = "") As %Status [ Internal ]