#NEWLINE# def measure_thousands_of_metrics( ) : #NEWLINE# #INDENT# dog = DogStatsApi ( ) #NEWLINE# dog . start ( api_key = 'apikey_3' , api_host = 'https://app.datad0g.com' ) #NEWLINE# yappi . start ( ) #NEWLINE# @ dog . timed ( 'timed' ) #NEWLINE# def timed( ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# for i in range ( 100 ) : #NEWLINE# #INDENT# for j in range ( 1000 ) : #NEWLINE# #INDENT# name = ( j % 100 ) #NEWLINE# dog . gauge ( ( 'gauge.%s' % name ) , j ) #NEWLINE# dog . increment ( ( 'counter.%s' % name ) , j ) #NEWLINE# dog . histogram ( ( 'histogram.%s' % name ) , j ) #NEWLINE# timed ( ) #NEWLINE# #UNINDENT# print ( ( 'run %s' % i ) ) #NEWLINE# #UNINDENT# yappi . print_stats ( sort_type = yappi . SORTTYPE_TSUB , sort_order = yappi . SORTORDER_DESC )