#NEWLINE# def add( self , name , metric ) : #NEWLINE# #INDENT# with name . lock : #NEWLINE# #INDENT# if ( name in self . metrics ) : #NEWLINE# #INDENT# raise RegistryException ( '{0} already present in the registry.' . format ( name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . metrics [ name ] = metric