Skip to main content

Ens.Util.Statistics

class Ens.Util.Statistics extends %Library.RegisteredObject

Container the queries used by Ensemble statistics page. Also contains methods to record activity statistics for given dimensions.

Method Inventory

Methods

classmethod DisableSAMForNamespace(Output pPrevious As %Boolean) as %Status
This method disables recording of metrics for SAM
classmethod DisableSAMIncludeHostLabel(Output pPrevious As %Boolean) as %Status
This method disallows the inclusion of the host label in the recording of metrics for SAM
classmethod DisableSAMIncludeProdLabel(Output pPrevious As %Boolean) as %Status
This method disallows the inclusion of the Production name as a label in the recording of metrics for SAM
classmethod DisableStatsForConfig(pConfigName As Ens.DataType.ConfigName = "", Output pPrevious As %Boolean) as %Status
This method disable statistics recording for the configuration item passed in.
The code within the method is subject to change.
classmethod DisableStatsForProduction(pProduction As %String = "", Output pPrevious As %Boolean) as %Status
This method disables statistics recording for all items running in a production in this namespace.
The first parameter is included to allow for future use.
The code within the method is subject to change.
classmethod EnableSAMForNamespace(Output pPrevious As %Boolean, pOn As %Boolean = 1) as %Status
This method enables recording of metrics for SAM
The default is off
classmethod EnableSAMIncludeHostLabel(Output pPrevious As %Boolean, pOn As %Boolean = 1) as %Status
This method allows the inclusion of the host label in the recording of metrics for SAM
The default is to include
classmethod EnableSAMIncludeProdLabel(Output pPrevious As %Boolean, pOn As %Boolean = 1) as %Status
This method allows the inclusion of the Production name as a label in the recording of metrics for SAM
The default is to include
classmethod EnableStatsForConfig(pConfigName As Ens.DataType.ConfigName = "", Output pPrevious As %Boolean, pOn As %Boolean = 1) as %Status
This method enables or disables statistics recording for the configuration item passed in.
The second parameter returned is the value of the setting prior to the change.
The third parameter specifies if enabled or disabled. The default is enabled.
The code within the method is subject to change.
classmethod EnableStatsForProduction(pProduction As %String = "", Output pPrevious As %Boolean, pOn As %Boolean = 1) as %Status
This method enables statistics recording for all items running in a production in this namespace.
The first parameter is included to allow for future use.
The second parameter returned is the value of the setting prior to the change.
The third parameter specifies if enabled or disabled. The default is enabled.
The code within the method is subject to change.
classmethod EnumerateCountersClose(ByRef qHandle As %Binary) as %Status
classmethod EnumerateCountersExecute(ByRef qHandle As %Binary) as %Status
classmethod EnumerateCountersFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod EnumerateHostStatusClose(ByRef qHandle As %Binary) as %Status
classmethod EnumerateHostStatusExecute(ByRef qHandle As %Binary) as %Status
classmethod EnumerateHostStatusFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod EnumerateJobStatusClose(ByRef qHandle As %Binary) as %Status
classmethod EnumerateJobStatusExecute(ByRef qHandle As %Binary, pHostName As %String = "") as %Status
classmethod EnumerateJobStatusFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod EnumerateMetricPropsClose(ByRef qHandle As %Binary) as %Status
classmethod EnumerateMetricPropsExecute(ByRef qHandle As %Binary, pName As %String = "") as %Status
classmethod EnumerateMetricPropsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod EnumerateMetricsClose(ByRef qHandle As %Binary) as %Status
classmethod EnumerateMetricsExecute(ByRef qHandle As %Binary) as %Status
classmethod EnumerateMetricsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod GetCounterValues(pHost As %String, ByRef pValues As %Integer, pCount As %Integer, pIntervalSize As %Integer, pSumOnly As %Boolean = 0) as %Integer
For a host pHost, return an array of count counter values in pValues subscripted by slot number. The final slot is the most recent values.
pCount is the number of values (intervals) to return. pIntervalSize is the size, in seconds of each slot (this should be a multiple of 10 and not greater than 3600).
If pSumOnly is true, then do not fill in pValues.
Returns the total number in all the slots.
classmethod GetSAMSensorSampler(pDefinitionClassname As %String, pDefinitionXDataName As %String, Output pIsSAMSamplingEnabled As %Boolean = 0, Output pSC As %Status = $$$OK) as Ens.SAM.SensorSampler
Return a SAM Sensor Sampler instantiated object based on a definition in XData
Initialize using data from JSON definition in XDataName of pDefinitionClassname
classmethod GetStatsUserDimension(pConfigName As %String = "", pConfigType As %Integer = 0) as %String
This returns the User Dimension from the in memory array.
classmethod GetTempStatsDaystoKeep() as %Integer
This method returns the maximum days to keep the statistics in temporary storage.
If statistics are not moved from temporary to permanent storage this is a safety
measure to prevent the temporary data growing.
This method returns the interval recording time.
The default if not set is 1 day.
classmethod InitStats(pConfigName As %String = "", pOverrideConfigSetting As %Boolean = 0) as %Boolean
Used to check if statistics ought to be collected and initializes if needed.
The code within the method is subject to change.
classmethod InstantiateSensorSampler(pSensorDefinition As %DynamicObject, Output pIsSAMSamplingEnabled As %Boolean = 0, ByRef pSC As %Status) as Ens.SAM.SensorSampler
Return a SAM Sensor Sampler instantiated object based on a definition in dynamic object
classmethod PurgeUncollectedStats(pDaysToKeep As %Integer = -1, Output pEntriesDeleted As %Integer = 0, pNamespaceToPurge As %String = $namespace) as %Status
Counters and Duration are stored in a temporary global before being moved to tables for analysis.
This method removes the temporary data that is older than pDaysToKeep.
This method is called daily in a running production by the background Ens.MonitorService using GetTempStatsDaystoKeep() for the pDaysToKeep value as a safeguard against growth of uncollected data.
If pDaysToKeep is 0 then the returned pEntriesDeleted will be -1 as the individual records deleted are not counted.
If no value is passed in for pDaysToKeep then the purge will exit immediately.
classmethod RecordStats(pConfigType As %Integer = 0, pConfigName As %String = "", pUserDimension As %String = "", pCleanupAfter As %Boolean = 1, pCount As %Integer = 1, pDuration As %Numeric)
This method will record the count and duration statistics to the temporary global.
Passing in pCount will override default count of 1.
Passing in pDuration will override calculated duration and override checking if stats have been started.
Negative Duration (calculated or passed in) is not used.
classmethod ReportItemsEnabledForStats(ByRef pItems, Output pAllItems As %Boolean = 0) as %Status
This method reports which items are enabled for statistics gathering.
The parameter is passed back an array if there are any items enabled/disabled individually.
The second parameter AllItems will indicate if all items are enabled.
classmethod SetStatsCounterInterval(pInterval As %Integer = 10) as %Integer
This method set the default interval recording time in seconds.
The minimum is 1 second.
It returns the interval used.
classmethod SetStatsUserDimension(pConfigName As %String = "", pUserDimension As %String = $$$StatsDefaultDimension)
This sets the User Dimension in the in memory array.
classmethod SetTempStatsDaystoKeep(pDaysToKeep As %Integer = 1) as %Integer
This method set the maximum days to keep the statistics in temporary storage.
The minimum is 1 day. Default is 1 day.
It returns the interval used.
classmethod StatsActive(pConfigName As %String = "") as %Boolean
Used to check if statistics are to be gathered.
The code within the method is subject to change.
classmethod StatsCounterInterval() as %Integer
This method returns the interval recording time.
classmethod StatsStarted(pConfigName As %String = "") as %Integer
This method tests if statistics gathering has started.

Queries

query EnumerateCounters()
Selects Category As %String, Item As %String, Count As %Integer
Returns a set of pre-defined counters
query EnumerateHostStatus()
Selects Name As %String, Type As %String, Status As %String, AdapterState As %String, LastActivity As %TimeStamp, ElapsedTime As %Integer, Queue As %Integer, Count As %Integer
Returns status for a set of hosts
Name is the name of the host item.
Type is the type (Service, Operation, etc.) of the host item.
Status is last reported status for the item.
AdapterState is connected status of jobs for this host.
LastActivity is local time of last activity on this host.
ElapsedTime is number of seconds from time of last activity on this host to now.
Queue is the current number of items in the queue associated with this item.
Count is the number of activities processed since it was started.
query EnumerateJobStatus(pHostName As %String)
Selects Name As %String, Job As %String, Status As %String, AdapterState As %String, LastActivity As %TimeStamp, Count As %Integer, Method As %String, Retry As %Integer, ActiveMessage As %String
Returns job status for a specific host
query EnumerateMetricProps(pName As %String = "")
Selects Instance As %String, Property As %String, Value As %String, History As %String
Returns values within a specific BusinessMetric cache
query EnumerateMetrics()
Selects Name As %String, LastUpdate As %TimeStamp, IsRunning As %Boolean
Returns contents of BusinessMetric cache

Inherited Members

Inherited Methods

FeedbackOpens in a new tab