#NEWLINE# def collect( self ) : #NEWLINE# #INDENT# stats_output = self . run_command ( [ ' stats' ] ) #NEWLINE# if ( stats_output is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# stats_output = stats_output [ 0 ] #NEWLINE# raw_histogram = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# include_hist = str_to_bool ( self . config [ 'histogram' ] ) #NEWLINE# for line in stats_output . splitlines ( ) : #NEWLINE# #INDENT# ( stat_name , stat_value ) = line . split ( '=' ) #NEWLINE# if ( not stat_name . startswith ( 'histogram' ) ) : #NEWLINE# #INDENT# self . publish ( stat_name , stat_value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if intv : #NEWLINE# #INDENT# hist_intv = float ( stat_name . split ( '.' , 4 ) [ 4 ] ) #NEWLINE# raw_histogram [ hist_intv ] = float ( stat_value ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if include_hist : #NEWLINE# #INDENT# histogram = self . get_massaged_histogram ( raw_histogram ) #NEWLINE# for ( intv , value ) in histogram . iteritems ( ) : #NEWLINE# #INDENT# self . publish ( ( 'histogram.' + intv ) , value )