Dashboard - Line Graph
Hello,
I want to create a dashboard with a line graph that shows system availability over time. I used this code to create a Dashboard:
Set tItem = ##class(%DeepSee.UserLibrary.Link).%New()
Set tItem.fullName = "Availability"
Set tPage = "Availability.UI.CSVImport.zen"
Set tItem.href = $system.CSP.GetPortalApp($namespace,tPage)_tPage
Set tItem.title = "Availability"
Set tSC = tItem.%Save()
I have a process in place that stores the data in a SQL table with three properties:
CreatedDate, CreatedTime, and availabilityStatus (Boolean).
I have defined a BusinessMetric as follows:
Class AETMON.Availability Extends Ens.BusinessMetric
Property AvailabilityHistory As Ens.DataType.Metric(AUTOHISTORY = 50) [ MultiDimensional ];
Query MetricInstances() As %SQLQuery
{
SELECT ID FROM AETMON.AvailabilityLog
}
Method OnCalculateMetrics() As %Status
{
Set tInstance=..%Instance
&SQL(SELECT availabilityStatus INTO :a FROM AETMON.AvailabilityLog WHERE ID=:tInstance)
Set ..AvailabilityHistory=a
Quit $$$OK
}
I am not sure if I need anything in OnGetInstances()
I am not sure what I need to update so I can see "AvailabilityHistory" on my dashboard.
Thanks for your help