Using tag scripts would probably not scale well for 100K tags. Read through this topic: Best practices and pitfalls with Tag Event Scrips. Here are some options:
-
You could try using pturmel's Integration Toolkit See this post: Best practice for tag calculating derivative (difference between values at 2 timestamps) - #2 by pturmel
-
You could also try calculating them in a gateway timer script, reading the tags together, storing the buffer for all the tags together in some dataset, and writing to the "average" tags together. (I'd also have the list of tagpaths in the dataset itself rather than browsing for tags). Though you'd definitely have to test for performance if you're going to do this for 100K tags at once; (Can the system.tag.read*() funcitons even take in that many paths?)
-
100K tags is a lot, but you could perhaps also experiment with system.tag.queryTagCalculations()?
I've done something similar using option 2 and have found it to be very performant, but it wasn't anything close to 100K tags.