persistent class SYS.Monitor.Health.Chart
extends %Persistent, %XML.Adaptor
Storage for Health Monitor Sensor Charts. Each SensorObject may have multiple Charts for different time Periods.
property AlertValue
as %String [ Calculated ];
Sensor Alert Value. The value which will trigger an Alert.
Computed based on Sensor Object and runtime statistics.
property HighValue
as %String [ InitialExpression = 0,Required ];
Sensor High Value. The highest value during the Period
property Mean
as %String;
Sensor mean
property PeriodID
as %String [ Required ];
Owner Period
property Readings
as %List;
Sensor readings
property SampleMeans
as %List;
Sensor mean samples
property SampleReadings
as %List;
Sensor readings samples
property Sensor
as %String(MAXLEN=250) [ Required ];
Sensor name
property SensorItem
as %String(MAXLEN=250) [ Required ];
Sensor item
relationship SensorObject
as SYS.Monitor.Health.SensorObject [ Inverse = Charts,Cardinality = one ];
Columns for this table
property Sigma
as %String;
Sensor standard deviation (sigma)
property Version
as %String(MAXLEN=250) [ Required ];
Version
property WarnValue
as %String [ InitialExpression = 0,Required ];
Sensor Warn Value. An adjusted warning value based on High Value
property WarningValue
as %String [ Calculated ];
Sensor Warning Value. The value which will trigger a warning.
Computed based on Sensor Object and runtime statistics.
method AlertValueGet()
as %String
returns Alert value
classmethod CreateChart(pID As %String, sensor As %String, mean As %Numeric = "", sigma As %Numeric = "", readings As %List = "", item As %String = "-", high As %String = "", warn As %String = "")
as %Status
Create a chart for a Period ID, sensor, and list of readings
classmethod SetChartStats(pID As %String, sensor As %String, readings As %List, item As %String = "-", highvalue As %String = 0, warnvalue As %String = 0)
as %Status
Set chart statistics based on list of values
method WarningValueGet()
as %String
returns Warning value
query Charts()
SQL Query
:
SELECT PeriodID,Sensor,SensorItem,Mean,Sigma,Version,%ID FROM Chart
A list of all charts
query ChartsByPeriod(period As %String)
SQL Query
:
SELECT Sensor,SensorItem,Mean,Sigma,%ID,Version FROM Chart WHERE (PeriodID = :period)
A list of all charts for a period
query ChartsByPeriodSensor(period As %String, sensor As %String)
SQL Query
:
SELECT PeriodID,Sensor,SensorItem,Mean,Sigma,%ID FROM Chart WHERE (Sensor = :sensor) AND (PeriodID = :period)
A list of all charts for a period and sensor
query ChartsByPeriodSensorItem(period As %String, sensor As %String, sensoritem As %String)
SQL Query
:
SELECT PeriodID,Sensor,SensorItem,Mean,Sigma,%ID FROM Chart WHERE (Sensor = :sensor) AND (PeriodID = :period) AND (SensorItem = :sensoritem)
A list of all charts for a period, sensor, and sensor item
query ChartsBySensor(sensor As %String)
SQL Query
:
SELECT PeriodID,Sensor,SensorItem,Mean,Sigma,%ID FROM Chart WHERE (Sensor = :sensor)
A list of all charts for a sensor
query ChartsBySensorItem(sensor As %String, sensoritem As %String)
SQL Query
:
SELECT PeriodID,Sensor,SensorItem,Mean,Sigma,%ID FROM Chart WHERE (Sensor = :sensor) AND (SensorItem = :sensoritem)
A list of all charts for a sensor / item
query ChartsByVersion(ver As %String)
SQL Query
:
SELECT %ID FROM Chart WHERE (Version = :ver)
A list of all charts for a version
index (IDKEY on PeriodID,Sensor,SensorItem) [IdKey,PrimaryKey,Unique];