SYS.History.SysData
Class SYS.History.SysData Extends (%Persistent, %XML.Adaptor) [ System = 4 ]
Basic detail collection class of System Usage metrics for the Monitor History database. Properties represent metrics which get collected every few minutes by the %MONAPP Application Monitor process when the %Monitor.System.HistorySys class is "active".
For details, see History Monitor.
Properties
DateTime
Property DateTime As %TimeStamp [ SqlColumnNumber = 2 ];
Time of sample
Length
Property Length As %Integer;
Length of sample in seconds
ZDATE
Property ZDATE As %Integer;
UTC date key
ZTIME
Property ZTIME As %Integer;
UTC time key
Sys
Property Sys As SYS.History.SystemUsage;
System usage metrics
DB
Property DB As array Of SYS.History.Database;
Database metrics
Methods
Sample
ClassMethod Sample() As SYS.History.SysData
Instantiate the class and fetch current values for all metric properties.
GetCPU
ClassMethod GetCPU() As %String [ Internal ]
Fetch CPU usage "kernel,user,idle,iowait" as percentage for a 1 second sample
UnixCPU
ClassMethod UnixCPU(debug) As %String [ Internal ]
Get Unix command for CPU usage for this platform We remember this in IRIS.Temp so we don't have to figure it out each time
Purge
ClassMethod Purge(Keep As %Integer = 0) As %Integer
Purge SysData interval data, keeping the last 'Keep' days. This is typically called at the start of each day from the %Monitor.System.HistorySys class, using the current system default for 'Keep' (see the SetPurge() method). The 'Keep' argument allows you to over ride the system default (a value of "0" or "" uses the system default)
Returns the number of entries purged.
Summary
ClassMethod Summary(Day As %Integer = 0) As %Status
Collect summaries of the SysData metrics for a day into the Hourly/Daily database. This is typically done automatically by %Monitor.System.HistorySys at the beginning of each day (for the previous day), but could be called manually if there's a problem.
The 'Day' argument sets the end date of the collection, with the default of "0" being the start of today (i.e. $H+Day), which would collect everything for yesterday. A "-1" would collect the day before yesterday; a "1" would collect today (as much as there is).
Demo
ClassMethod Demo(Days As %Integer = 30) As %Status [ Internal ]
Build a demo database for the Sys metrics. 'Days' is the number of days of history to generate.
DemoSample
ClassMethod DemoSample(pct As %Integer, ByRef DB As %String) As SYS.History.SysData [ Internal ]
Instantiate the class and fetch values for all metric properties. This fills in semi-random values from a base value for each metric for a demo database. 'pct' is a percentage value used to modify (+ or -) the base values. 'dt' is date,time of sampel in $H format 'DB" is array of database names/sizes
Export
ClassMethod Export(FileName As %String, Start As %TimeStamp, End As %TimeStamp) As %Status
Export SystemUsage data for a time range in CSV format. The default is all of the data currently in the SysData class.
The default FileName is HistorySys_config_date_time.csv in the MGR directory.
'Start' and 'End' times (if necessary) are in YYYY-MM-DD HH:MM:SS format.
ExportDB
ClassMethod ExportDB(FileName As %String, Start As %TimeStamp, End As %TimeStamp, Database As %String) As %Status
Export Database data for a time range in CSV format. The default is all of the data currently in the SysData class.
The default 'FileName' is HistoryDB_config_date_time.csv in the MGR directory.
'Start' and 'End' times (if necessary) are in YYYY-MM-DD HH:MM:SS format.
The 'Database' argument can select (by name) a single database to export. Otherwise, data for all databases is exported and the database name is exported as a column.