An example that monitors the status of 30 switches.
Every switch has four to six sensors associated with it. Every sensor is either a voltage or current sensor. Every switch reports once per second on its state, which may be "on" (closed) or "off" (open); this information arrives in input stream StreamSwitchStates. Every sensor reports its value once per second; these rows arrive in streams StreamVoltage or CurrentAlerts, whichever is appropriate.
The queries in this example generate two kinds of alerts: "swing alerts" and "switch alerts". Swing alerts are issued when the value reported by a single sensor changes by at least a threshold amount within a specified interval. Switch alerts are generated when a switch is thrown, but the voltage or current reported by at least one of the switch's associated sensors does not change significantly and immediately.