Dif of two infotables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Dif of two infotables
Hi,
I would like to accomplish a comparison of two Infotables.
I have one property, type of Infotable. This property is updated by scheduled event. It could change (it could be one or more new entries in it)
I am updating the Infotable as whole i.e.:
var tempTable = parseResult();
Things[myThing].myTable = tempTable;
I would like to have a subscription which would take an old value and new value of that infotable and spit out new/added entries.
I was doing some loop functions, but they are not very effective.
Any ideas?
- Labels:
-
Troubleshooting
- Tags:
- infotables
- services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
What are some of the functions you have attempted so far? Will there be a constant number of rows in the infotable property our could this vary? Iterating through the tables and comparing the values is the main method that comes to mind.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Besides what you've tried so far, what isn't effective?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Pai,
I was iterating through the new infotable and using EQfilter on the old one.
I have almost 1500 Things which they are containing this infotable property. Firstly I had a Scheduler thing with service doing all that work one Thing at the time.
It took about 20s to complete. There is no performance monitor in Thingworx (which would be great btw) so I dont know if this is a right approach once I'll scale.
Secondly I had a Subscription service (on DataChange) directly inside all of those Things. Same problem - I cannot tell what does it do for rest of the system. (Is it blocking or non-blocking, every scope running in separate thread or job?) What happen if I scale to lets say 10k Things?
Performance monitor would be a great tool. I am still afraid that one time it will "bite me".
What do you suggest?
Tomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It may be better to use a single row edit approach vs. having to hunt for changes in the infotable. Not sure if that is at all possible.
else maybe just maybe appending the column(s) and using DeriveFields after that could be faster?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks,
and what about Helper Thing containing a service handling one Thing at a time
vs
Subscription service triggered by DataChange event, in each Thing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I think it would be the same amount of threads. You could perhaps have the subscription invoke an async service?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks I will try that and see.
Tomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I think subscriptions already spawn their own thread, so firing an async service from there would just spawn another new thread and release the previous thread.
