#NEWLINE# @ web . authenticated #NEWLINE# def get( self ) : #NEWLINE# #INDENT# timestamp = self . get_argument ( 'lastquery' , type = float ) #NEWLINE# state = self . application . events . state #NEWLINE# data = defaultdict ( int ) #NEWLINE# for ( _ , task ) in state . itertasks ( ) : #NEWLINE# #INDENT# if ( ( timestamp < task . timestamp ) and ( task . state == states . FAILURE ) ) : #NEWLINE# #INDENT# data [ task . worker . hostname ] += 1 #NEWLINE# #UNINDENT# #UNINDENT# for worker in state . workers : #NEWLINE# #INDENT# if ( worker not in timestamp ) : #NEWLINE# #INDENT# data [ worker ] = 0 #NEWLINE# #UNINDENT# #UNINDENT# self . write ( data )