Datapoints record alert
-
Hi!
I have a problem with some dev users, where they usually create test datasources with a very short update timing or write a big script in a DS Meta with several changing context points which may generate a unnecessary writing values and processing. We stablish that 1 register each 30 sec is the shortest time period we should use. However those users usually forget that, Since we use Oracle with our SCADA system, I set up an alert in the DB where if a DP records more than 2880 a day, it sends me an alert email to check that DP.
Is it possible to use a similar control using mango's NoSql db?Thanks
-
Hi Ava2018, welcome to the forum!
On the NoSQL database, I would recommend someone attempt to achieve that via either counting the points' value from a script in Mango and outputting a list of points with over or under counts into alphanumeric points, something like
var overcounts = []; var undercounts = []; for(var contextPoint in CONTEXT_POINTS) { var count = this[contextPoint].past(DAY].count; if( count > 2880 ) overcounts.push( this[contextPoint].getDataPointWrapper().getExtendedName() ); else if( count < 2880 ) undercounts.push( this[contextPoint].getDataPointWrapper().getExtendedName() ); } //these two points would be alphanumeric points on the scripting data source: overcountPoint.set(JSON.stringify(overcounts)); undercountPoint.set(JSON.stringify(undercounts));
or that they achieve it by querying a /rest/v2/point-values/ endpoint for a count rollup,
I should also say that we mitigated the issue of multiple context points updating at the same millisecond being a great source of inefficiency by tracking if there are multiple updates at the latest millisecond and only accepting one of them. It doesn't mitigate the issue if the values are backdated, though. The updates only trigger the execution, but their having arrived is not necessary for the values to be available in the cache, but it is a race condition and one of the possible reasons to introduce an execution delay on a meta point.
You could also have the meta points executing on a cron, which would eliminate the issue.
-
Good!
I will try to implement the script.Thank you very much the quick response phildunlap!