@ricardo said in Percent Used Bar Chart:
Would you suggest to change the meta data point from update hourly interval to possibly update by context update?
No because that means your code would fire and look at the previous hour every time an update came in.
However, the client would like to do further analytics by binning the occupied time into 3 groups: <1 min, <10min and >10min.
Then I advise you look at my initial suggestion as I figured this would happen. You need this to work as occupied events, not just overall statistics. These events can then be evaluated and set a value on a datapoint that represents each timeframe. I'd advise a scripting datasource in this instance as each datapoint mentioned all relates basck to the same script.
Also, please read the docs and give things a go. We're not here to do your job for you.
The StartsAndRuntimeList object is returned by Binary and Multistate points. It contains the following properties:
periodStartTime (integer) the start time used for the calculation
periodEndTime (integer) the end time used for the calculation
--> count (integer) count of the total number of entries
startValue: the value before or exactly at the period start time
firstValue: the first value in the period
firstTime: (integer) the time of the first value
lastValue: the last value in the period
lastTime: (integer) the time of the last value
data: (array) the list of individual StartAndRuntime objects.
Each StartAndRuntime object has the following properties:
value: (boolean for Binary, integer for Multistate) the point state to which the remaining properties apply
starts: (integer) the number of times the state was entered over the period
--> runtime: (integer) the amount of time in milliseconds the point was in the state over the period
proportion: (float) the proportion of the period the point was in the state (runtime / real duration)