#NEWLINE# def get_stats_lock_statistics( db_connection ) : #NEWLINE# #INDENT# ( locks_by_type , [ total_locks_waiting , total_locks_granted ] ) = get_lock_statistics ( db_connection ) #NEWLINE# metrics = [ ] #NEWLINE# for ( lock_type , [ locks_waiting , locks_granted ] ) in locks_by_type . iteritems ( ) : #NEWLINE# #INDENT# metrics . append ( metric_locks_granted ( lock_type , locks_granted ) ) #NEWLINE# metrics . append ( metric_locks_waiting ( lock_type , locks_waiting ) ) #NEWLINE# #UNINDENT# metrics . append ( metric_locks_granted ( 'total' , total_locks_granted ) ) #NEWLINE# metrics . append ( metric_locks_waiting ( 'total' , total_locks_waiting ) ) #NEWLINE# return metrics