Home > Class Reference > ENSLIB namespace > %SYS.Monitor.Reading

%SYS.Monitor.Reading

persistent class %SYS.Monitor.Reading extends %Library.Persistent

SQL Table Name: %SYS_Monitor.Reading

A single value for a Dashboard Sensor gathered at a specific time. The collected history of a Sensor is kept as children of %SYS.Monitor.Sensor.

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

relationship Sensor as %SYS.Monitor.Sensor [ Required , Inverse = Readings , Cardinality = parent ];
Property methods: SensorCheck(), SensorDelete(), SensorGet(), SensorGetObject(), SensorGetObjectId(), SensorGetStored(), SensorGetSwizzled(), SensorIsValid(), SensorNewObject(), SensorOnDelete(), SensorRClose(), SensorRExec(), SensorRFetch(), SensorRelate(), SensorSQLCompute(), SensorSet(), SensorSetObject(), SensorSetObjectId(), SensorUnRelate(), SensorUnSwizzle()
property Value as %String;
Property methods: ValueDisplayToLogical(), ValueGet(), ValueGetStored(), ValueIsValid(), ValueLogicalToDisplay(), ValueLogicalToOdbc(), ValueNormalize(), ValueSet()

Methods (Including Private)

classmethod GetReadings(sid As %String = "", iid As %String = "", sPer As %Integer, sTime As %String, ByRef readings As %ListOfObjects) as %Integer
INPUTS sid: A string defining the sensor's name, or null if all sensor's readings should be returned iid: A string defining the sensor's item, or null if all sensor's readings should be returned sPer: An integer defining the sample period of which to return readings sTime: A string in timestamp format that defines the starting point to get data from readings: A list of objects passed in by reference that will be populated with sensor data RETURNS code: the http code (204 if no data was found, 200 if data was found)
classmethod NewInterval(start As %TimeStamp, read As %TimeStamp, sPer As %Integer) as %Integer
classmethod Purge(Time As %TimeStamp) as %Status
Purge old readings, up to 'Time' argument (in %TimeStamp format).

Queries

query ListAll(BeginTime As %TimeStamp, EndTime As %TimeStamp = {$zdt($h, 3)})
SQL Query:
SELECT Sensor->Name As Sensor, Sensor->Item As Item, %SYS_Monitor.Reading_LocalTime(ReadTime), Value FROM %SYS_Monitor.Reading WHERE %SYS_Monitor.Reading_LocalTime(ReadTime) BETWEEN :BeginTime AND :EndTime
Return the sensor data for a given time range
query ListAllUTC(BeginTime As %TimeStamp, EndTime As %TimeStamp = {$zdt($zts, 3)})
SQL Query:
SELECT Sensor->Name As Sensor, Sensor->Item As Item, ReadTime, Value FROM %SYS_Monitor.Reading WHERE ReadTime BETWEEN :BeginTime AND :EndTime
Return the sensor data for a given time range. Uses UTC time for arguments and data.
query ListSensor(Sensor As %String, Item As %String, BeginTime As %TimeStamp, EndTime As %TimeStamp = {$zdt($h, 3)})
SQL Query:
SELECT %SYS_Monitor.Reading_LocalTime(ReadTime),Value FROM %SYS_Monitor.Reading WHERE %SYS_Monitor.Reading_LocalTime(ReadTime) BETWEEN :BeginTime AND :EndTime AND Sensor->Name = :Sensor AND Sensor->Item = :Item
Return the sensor data for a given Sensor.Item. 'Item' must be '-' for a top level Sensor.
query ListSensorUTC(Sensor As %String, Item As %String, BeginTime As %TimeStamp, EndTime As %TimeStamp = {$zdt($zts, 3)})
SQL Query:
SELECT ReadTime,Value FROM %SYS_Monitor.Reading WHERE ReadTime > :BeginTime AND ReadTime <= :EndTime AND Sensor->Name = :Sensor AND Sensor->Item = :Item
Return the sensor data for a given Sensor.Item. 'Item' must be '-' for a top level Sensor. Uses UTC time for arguments and data.

Indexes

index (TimeIndex on ReadTime) [IdKey, Type = key, Unique];
Index methods: TimeIndexCheck(), TimeIndexDelete(), TimeIndexExists(), TimeIndexOpen(), TimeIndexSQLCheckUnique(), TimeIndexSQLExists(), TimeIndexSQLFindPKeyByConstraint(), TimeIndexSQLFindRowIDByConstraint()

Inherited Members

Inherited Methods (Including Private)

Storage

Storage Model: CacheStorage (%SYS.Monitor.Reading)

{%%PARENT}("Readings")(ID)
=
%%CLASSNAME
Value