#NEWLINE# def handle_event( self , event , count , qk = 'all' ) : #NEWLINE# #INDENT# self . first_event . setdefault ( qk , event ) #NEWLINE# self . ref_windows . setdefault ( qk , EventWindow ( self . timeframe , getTimestamp = self . get_ts ) ) #NEWLINE# self . cur_windows . setdefault ( qk , EventWindow ( self . timeframe , self . ref_windows [ qk ] . append , self . get_ts ) ) #NEWLINE# self . cur_windows [ qk ] . append ( ( event , count ) ) #NEWLINE# if ( ( event [ self . ts_field ] - self . first_event [ event ] [ self . ts_field ] ) < ( self . rules [ 'timeframe' ] * 2 ) ) : #NEWLINE# #INDENT# if ( not self . ref_window_filled_once ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( not ( self . rules . get ( 'query_key' ) and self . rules . get ( 'alert_on_new_data' ) ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( ( qk in self . skip_checks ) and ( event [ self . ts_field ] < self . skip_checks [ qk ] ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . ref_window_filled_once = True #NEWLINE# #UNINDENT# if self . find_matches ( self . ref_windows [ qk ] . count ( ) , self . cur_windows [ qk ] . count ( ) ) : #NEWLINE# #INDENT# for ( match , count ) in self . cur_windows [ qk ] . data : #NEWLINE# #INDENT# if count : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# self . add_match ( match , qk ) #NEWLINE# self . clear_windows ( qk , match )