title: Use python to count the number of events in a specified amount of time
body: <p>I'm monitoring a json stream for specific events.  I'd like to count the number of events that occur in a specific amount of time, say events per minute, then compare to a high water mark to take action.</p>
  
  <pre><code>for l in s.makefile() :
  m = json.loads(l)
  if 'Event' in m and m['Event'] == 'StarLost' :
      print 'Star Lost at time= ' + str(datetime.datetime.fromtimestamp(m['Timestamp']))
  </code></pre>