%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
Method Inventory
Properties
relationship Sensor as %SYS.Monitor.Sensor [ Required , Inverse = Readings , Cardinality = parent ];
Property methods: 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
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
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
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
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
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
- %%CLASSNAMELogicalToStorage()
- %%CLASSNAMEStorageToLogical()
- %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()
- %OnDeleteFinally()
- %OnDetermineClass()
- %OnOpenFinally()
- %OnSaveFinally()
- %Open()
- %OpenId()
- %OriginalNamespace()
- %PackageName()
- %PhysicalAddress()
- %PurgeIndices()
- %Reload()
- %RemoveFromSaveSet()
- %ResolveConcurrencyConflict()
- %RollBack()
- %Save()
- %SaveDirect()
- %SaveIndices()
- %SerializeObject()
- %SetModified()
- %SortBegin()
- %SortEnd()
- %SyncObjectIn()
- %SyncTransport()
- %UnlockExtent()
- %UnlockId()
- %ValidateIndices()
- %ValidateObject()
- %ValidateTable()
Storage
Storage Model: Storage (%SYS.Monitor.Reading)
{%%PARENT}("Readings")(ID) |
= | %%CLASSNAME
Value
|