#NEWLINE# def _get_plugin_stats( self , name ) : #NEWLINE# #INDENT# '\n        Used for getting stats for Plugin based stuff, like Kafka Monitor\n        and Redis Monitor\n\n        @param name: the main class stats name\n        @return: A formatted dict of stats\n        ' #NEWLINE# the_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# keys = self . redis_conn . keys ( 'stats:{n}:*' . format ( n = name ) ) #NEWLINE# for key in keys : #NEWLINE# #INDENT# elements = key . split ( ':' ) #NEWLINE# main = elements [ 2 ] #NEWLINE# end = elements [ 3 ] #NEWLINE# if ( ( main == 'total' ) or ( main == 'fail' ) ) : #NEWLINE# #INDENT# if ( main not in the_dict ) : #NEWLINE# #INDENT# the_dict [ main ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# the_dict [ main ] [ end ] = self . _get_key_value ( key , ( name == 'lifetime' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'plugins' not in the_dict ) : #NEWLINE# #INDENT# the_dict [ 'plugins' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( main not in the_dict [ 'plugins' ] ) : #NEWLINE# #INDENT# the_dict [ 'plugins' ] [ main ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# the_dict [ 'plugins' ] [ main ] [ end ] = self . _get_key_value ( key , ( end == 'lifetime' ) ) #NEWLINE# #UNINDENT# #UNINDENT# return the_dict