Community Tip - You can change your system assigned username to something more personal in your community settings. X
Solved! Go to Solution.
Hi @LeoChen ,
Your subscription code requires a fix, because you're verifying the value at the end, and you should look at the quality.
The first part will also always evaluate to true and even if you compare the oldValue to newValue, it's still simpler to just look at the quality:
if (eventData.newValue.quality!="GOOD")
Hi @LeoChen,
Kindly refer the attached link. I hope it may be helpful in your query.
Monitor Quality of Tags:https://community.ptc.com/t5/ThingWorx-Developers/How-to-monitor-the-quality-of-the-bound-tag/td-p/710794
Thanks & Regards,
Arun C
Thank you. But I need to know how to minimal impact on system. Because the count of property is to much,
Now I creat subscription with the event of AntDataChange,which is not very well.
Regards.
Hi @LeoChen.
Are there some tags that are more important to monitor? Instead of monitoring all 1000 tags, you could monitor for the isConnected property or you could monitor to validate that updates are occurring. Generally if you begin to see problems with the quality, there is a greater underlying problem and should not be necessary to monitor all tags to determine this.
You could also create a dashboard to provide a visual of what's happening in your network.
Regards.
--Sharon
Hello,
I can only think of the AnyDataChange, too.
What exactly is the issue with this approach? Does it slow your system down? If yes, you can share the body of this subscription, maybe we'll be able to give some advice on optimizing it.
/ Constantine
I'm aligned with Constantine here. You do need to verify each property value incoming in ThingWorx to see which is Quality BAD. In a subscription it will be very fast to check via an "if" the quality. I doubt it will be faster at this level if you do it in a Java extension, so I'm also curious to see what exactly are performance concerns and the subscription code.
subscription is very simple.
Hi @LeoChen ,
Your subscription code requires a fix, because you're verifying the value at the end, and you should look at the quality.
The first part will also always evaluate to true and even if you compare the oldValue to newValue, it's still simpler to just look at the quality:
if (eventData.newValue.quality!="GOOD")
OK. Thank you.
Vladimir's answer should be enough for this to scale.
Just to add, if you need to use "and" logic, you should use && instead of &, otherwise it will always evaluate both sides.
Also, it's better to use !== instead of != to avoid JavaScript type coercion, although I don't think it will make it more performant.
Finally, if you still experience performance issues after applying Vladimir's suggestion, check that those subscriptions are triggered on behalf of an admin user -- this would disable permission checks, making such frequent simple service calls even faster.
/ Constantine