cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Dif of two infotables

tcoufal
12-Amethyst

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?

8 REPLIES 8
smanley
13-Aquamarine
(To:tcoufal)

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.

PaiChung
22-Sapphire I
(To:tcoufal)

Besides what you've tried so far, what isn't effective?

tcoufal
12-Amethyst
(To:PaiChung)

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

PaiChung
22-Sapphire I
(To:tcoufal)

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?

tcoufal
12-Amethyst
(To:PaiChung)

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?

PaiChung
22-Sapphire I
(To:tcoufal)

I think it would be the same amount of threads. You could perhaps have the subscription invoke an async service?

tcoufal
12-Amethyst
(To:PaiChung)

Thanks I will try that and see.

Tomas

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.

Top Tags