Learning
Documentation
Community
Open Exchange
Global Masters
Home / Class Reference / ENSLIB namespace / %SYS.Monitor.Reading
Private  Storage   

%SYS.Monitor.Reading


persistent class %SYS.Monitor.Reading extends
%Persistent

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.

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
4 8 4 1


Summary


Properties
Sensor Value

Methods
%AddToSaveSet %AddToSyncSet %BMEBuilt %BuildIndicesAsync
%BuildIndicesAsyncResponse %CheckConstraints %CheckConstraintsForExtent %ClassIsLatestVersion
%ClassName %ComposeOid %ConstructClone %Delete
%DeleteExtent %DeleteId %DispatchClassMethod %DispatchGetModified
%DispatchGetProperty %DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty
%DispatchSetProperty %Exists %ExistsId %Extends
%GUID %GUIDSet %GetLock %GetParameter
%GetSwizzleObject %Id %InsertBatch %IsA
%IsModified %IsNull %KillExtent %KillExtentData
%LoadFromMemory %LockExtent %LockId %New
%NormalizeObject %ObjectIsNull %ObjectModified %Oid
%OnBeforeAddToSync %OnDetermineClass %Open %OpenId
%OriginalNamespace %PackageName %PhysicalAddress %PurgeIndices
%Reload %RemoveFromSaveSet %ResolveConcurrencyConflict %RollBack
%Save %SaveDirect %SaveIndices %SerializeObject
%SetModified %SortBegin %SortEnd %SyncObjectIn
%SyncTransport %UnlockExtent %UnlockId %ValidateIndices
%ValidateObject GetReadings NewInterval Purge


Properties


• relationship Sensor as %SYS.Monitor.Sensor [ Inverse = Readings,Cardinality = parent ];
• property Value as %String;

Methods


• 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.

Indices


•index (TimeIndex on ReadTime) [IdKey,Unique];