#NEWLINE# def do_benchmark( ) : #NEWLINE# #INDENT# THREAD_COUNT = 1 #NEWLINE# ENTRY_COUNT = ( 10 * 1000 ) #NEWLINE# VALUE_SIZE = 10000 #NEWLINE# GET_PERCENTAGE = 40 #NEWLINE# PUT_PERCENTAGE = 40 #NEWLINE# logging . basicConfig ( format = '%(asctime)s%(msecs)03d [%(name)s] %(levelname)s: %(message)s' , datefmt = '%H:%M%:%S,' ) #NEWLINE# logging . getLogger ( ) . setLevel ( logging . INFO ) #NEWLINE# logger = logging . getLogger ( 'main' ) #NEWLINE# config = hazelcast . ClientConfig ( ) #NEWLINE# config . group_config . name = 'dev' #NEWLINE# config . group_config . password = 'dev-pass' #NEWLINE# config . network_config . addresses . append ( '127.0.0.1:5701' ) #NEWLINE# client = hazelcast . HazelcastClient ( config ) #NEWLINE# my_map = client . get_map ( 'default' ) #NEWLINE# for i in xrange ( 0 , 1000 ) : #NEWLINE# #INDENT# key = int ( ( random . random ( ) * ENTRY_COUNT ) ) #NEWLINE# operation = int ( ( random . random ( ) * 100 ) ) #NEWLINE# if ( operation < GET_PERCENTAGE ) : #NEWLINE# #INDENT# my_map . get ( key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( operation < ( GET_PERCENTAGE + PUT_PERCENTAGE ) ) : #NEWLINE# #INDENT# my_map . put ( key , ( 'x' * VALUE_SIZE ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# my_map . remove ( key )