#NEWLINE# def clear( self ) : #NEWLINE# #INDENT# with self . lock : #NEWLINE# #INDENT# for metric in self . metrics . values ( ) : #NEWLINE# #INDENT# if hasattr ( metric , 'stop' ) : #NEWLINE# #INDENT# metric . stop ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . metrics . clear ( )