Be aware that time-based windows can empty
Consider the query below:
from s in Shipment(destination="SPQ")
within 604800.0
select sum(s.qty)/count()
After creation of the query, suppose that several shipments are sent in the first week and no shipments are sent in the second week. The value of the count() aggregate function drops to zero, which results in an attempt to divide by zero. This terminates the monitor instance.