Skip to main content


abstract class SYS.History.UserAbstract

Abstract class used as the parent of all collection classes for user-defined metrics. The SYS.History.User* classes are generated by inheriting from this class and then adding the user-defined classes as embedded objects. This includes User, UserPerf, UserSys, UserHourly and UserDaily.

See SYS.History.Adaptor for details about how to create user-defined metrics for SYS.History

Property Inventory

Method Inventory


property DateTime as %TimeStamp;
Time of sample
Property methods: DateTimeDisplayToLogical(), DateTimeGet(), DateTimeIsValid(), DateTimeLogicalToDisplay(), DateTimeNormalize(), DateTimeOdbcToLogical(), DateTimeSet()
property ZDATE as %Integer;
UTC date key
Property methods: ZDATEDisplayToLogical(), ZDATEGet(), ZDATEIsValid(), ZDATELogicalToDisplay(), ZDATENormalize(), ZDATESet()
property ZTIME as %Integer;
UTC time key
Property methods: ZTIMEDisplayToLogical(), ZTIMEGet(), ZTIMEIsValid(), ZTIMELogicalToDisplay(), ZTIMENormalize(), ZTIMESet()


classmethod Export(Property As %String, FileName As %String, Start As %TimeStamp, End As %TimeStamp, Function As %String) as %Status
Export user-defined data for time range in CSV format. The default is all of the data currently in the user-defined class, except those defined as %ArrayOfObjects in the User class, or ARRAY=1 and ARRAYSUM=0 in the Hourly/Daily classes.

- The 'Property' argument allows you to select a single user-defined class, including ones which are defined as %ArrayOfObjects, by specifying the string used as the embedded property name.
- The default FileName is HistoryUser_config_date_time.csv in the MGR directory.
- 'Start' and 'End' times (if necessary) are in YYYY-MM-DD HH:MM:SS format.
- 'Function' can be a comma-delimited list one or more of these summary functions: "Avg", "Max", "Min", StDev", Med" or "Tot". The default is to include all summary functions. Only used for Hourly/Daily summary classes, otherwise ignored.
classmethod Purge(Keep As %Integer = 0) as %Integer
Purge user-defined interval data, keeping the last 'Keep' days. For Interval and Hourly data this is typically called at the start of each day from the %Monitor.System.History class using the current system default for 'Keep' (see the SetPurge() method in PerfData and Hourly). For Daily data it must be manually called.
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.
classmethod Sample() as %RegisteredObject
Instantiate the class and fetch current values for all metric properties.
classmethod Summary(Day As %Integer = 0) as %Status
Collect summaries of the user-defined metrics for a day into the Hourly/Daily database. This is typically done automatically by the %Monitor.System.History* classes at beginning of each day (for the previous day), but could be called manually if there's a problem. Not valid for UserDaily or UserHourly classes.

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).
FeedbackOpens in a new tab