I would consider the update/speed at which the switch switches. Personally I would wire to an input of a PLC and use a counter or other means to increment count, then send that value to tag history. If you miss counts you are still covered by accumulated value.
Then use something like this, Tag history difference over interval - #2 by jlandwerlen