<s> from __future__ import with_statement <EOL> have_multiproc = False <EOL> try : <EOL> from multiprocessing import Array as array , Process as Thread <EOL> from uuid import uuid1 as get_ident <EOL> array ( '<STR_LIT:i>' , <NUM_LIT:1> ) <EOL> Thread . isAlive = Thread . is_alive <EOL> have_multiproc = True <EOL> except ImportError : <EOL> from threading import Thread <EOL> from thread import get_ident <EOL> from array import array <EOL> from hashlib import md5 <EOL> import time , random , sys , os <EOL> from random import randint , gauss <EOL> from optparse import OptionParser <EOL> from thrift . transport import TTransport <EOL> from thrift . transport import TSocket <EOL> from thrift . transport import THttpClient <EOL> from thrift . protocol import TBinaryProtocol <EOL> try : <EOL> from thrift_cass import Cassandra <EOL> from thrift_cass . ttypes import * <EOL> except ImportError : <EOL> L = os . path . abspath ( __file__ ) . split ( os . path . sep ) [ : - <NUM_LIT:3> ] <EOL> root = os . path . sep . join ( L ) <EOL> _ipath = os . path . join ( root , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> sys . path . append ( os . path . join ( _ipath , '<STR_LIT>' ) ) <EOL> import Cassandra <EOL> from ttypes import * <EOL> except ImportError : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:2> ) <EOL> try : <EOL> from thrift . protocol import fastbinary <EOL> except ImportError : <EOL> print "<STR_LIT>" <EOL> parser = OptionParser ( ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:int>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , default = <NUM_LIT:1000> ** <NUM_LIT:2> ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:float>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , default = <NUM_LIT:0> ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:int>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , default = <NUM_LIT:50> ) <EOL> parser . add_option ( '<STR_LIT:-c>' , '<STR_LIT>' , type = "<STR_LIT:int>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , default = <NUM_LIT:5> ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:int>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , default = <NUM_LIT> ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:int>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , default = <NUM_LIT:50> ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:string>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , default = "<STR_LIT:localhost>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:string>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , default = None ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:float>" , dest = "<STR_LIT>" , default = <NUM_LIT:0.1> , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , action = "<STR_LIT:store_true>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:string>" , dest = "<STR_LIT:file>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:int>" , default = <NUM_LIT> , dest = "<STR_LIT:port>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , action = "<STR_LIT:store_true>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT>" , dest = "<STR_LIT>" , <EOL> default = "<STR_LIT>" , choices = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:int>" , dest = "<STR_LIT>" , default = <NUM_LIT:1> , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT>" , dest = "<STR_LIT>" , <EOL> choices = ( '<STR_LIT>' , '<STR_LIT>' ) , default = '<STR_LIT>' , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , action = "<STR_LIT:store_true>" , dest = "<STR_LIT:ignore>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:int>" , default = <NUM_LIT:10> , <EOL> dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:int>" , default = <NUM_LIT:1000> , <EOL> dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:int>" , default = <NUM_LIT:1> , <EOL> dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT:str>" , default = '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , type = "<STR_LIT>" , <EOL> choices = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:none>' ) , default = '<STR_LIT:none>' , <EOL> dest = "<STR_LIT:index>" , help = "<STR_LIT>" ) <EOL> ( options , args ) = parser . parse_args ( ) <EOL> total_keys = options . numkeys <EOL> n_threads = options . threads <EOL> keys_per_thread = total_keys / n_threads <EOL> columns_per_key = options . columns <EOL> supers_per_key = options . supers <EOL> nodes = options . nodes . split ( '<STR_LIT:U+002C>' ) <EOL> if options . nodefile != None : <EOL> with open ( options . nodefile ) as f : <EOL> nodes = [ n . strip ( ) for n in f . readlines ( ) if len ( n . strip ( ) ) > <NUM_LIT:0> ] <EOL> fmt = '<STR_LIT>' + str ( len ( str ( total_keys ) ) ) + '<STR_LIT:d>' <EOL> stdev = total_keys * options . stdev <EOL> mean = total_keys / <NUM_LIT:2> <EOL> consistency = getattr ( ConsistencyLevel , options . consistency , None ) <EOL> if consistency is None : <EOL> print "<STR_LIT>" % options . consistency <EOL> sys . exit ( <NUM_LIT:3> ) <EOL> def generate_values ( ) : <EOL> values = [ ] <EOL> for i in xrange ( <NUM_LIT:0> , options . cardinality ) : <EOL> h = md5 ( str ( i ) ) . hexdigest ( ) <EOL> values . append ( h * int ( options . column_size / len ( h ) ) + h [ : options . column_size % len ( h ) ] ) <EOL> return values <EOL> def key_generator_gauss ( ) : <EOL> while True : <EOL> guess = gauss ( mean , stdev ) <EOL> if <NUM_LIT:0> <= guess < total_keys : <EOL> return fmt % int ( guess ) <EOL> def key_generator_random ( ) : <EOL> return fmt % randint ( <NUM_LIT:0> , total_keys - <NUM_LIT:1> ) <EOL> key_generator = key_generator_gauss <EOL> if options . random : <EOL> key_generator = key_generator_random <EOL> def get_client ( host = '<STR_LIT:127.0.0.1>' , port = <NUM_LIT> ) : <EOL> socket = TSocket . TSocket ( host , port ) <EOL> if options . unframed : <EOL> transport = TTransport . TBufferedTransport ( socket ) <EOL> else : <EOL> transport = TTransport . TFramedTransport ( socket ) <EOL> protocol = TBinaryProtocol . TBinaryProtocolAccelerated ( transport ) <EOL> client = Cassandra . Client ( protocol ) <EOL> client . transport = transport <EOL> return client <EOL> def make_keyspaces ( ) : <EOL> colms = [ ] <EOL> if options . index == '<STR_LIT>' : <EOL> colms = [ ColumnDef ( name = '<STR_LIT>' , validation_class = '<STR_LIT>' , index_type = IndexType . KEYS ) ] <EOL> elif options . index == '<STR_LIT>' : <EOL> colms = [ ColumnDef ( name = '<STR_LIT>' , validation_class = '<STR_LIT>' , index_type = IndexType . KEYS_BITMAP ) ] <EOL> cfams = [ CfDef ( keyspace = '<STR_LIT>' , name = '<STR_LIT>' , column_metadata = colms ) , <EOL> CfDef ( keyspace = '<STR_LIT>' , name = '<STR_LIT>' , column_type = '<STR_LIT>' ) ] <EOL> keyspace = KsDef ( name = '<STR_LIT>' , strategy_class = '<STR_LIT>' , replication_factor = options . replication , cf_defs = cfams ) <EOL> client = get_client ( nodes [ <NUM_LIT:0> ] , options . port ) <EOL> client . transport . open ( ) <EOL> try : <EOL> client . system_add_keyspace ( keyspace ) <EOL> print "<STR_LIT>" % len ( nodes ) <EOL> time . sleep ( len ( nodes ) ) <EOL> except InvalidRequestException , e : <EOL> print e . why <EOL> client . transport . close ( ) <EOL> class Operation ( Thread ) : <EOL> def __init__ ( self , i , opcounts , keycounts , latencies ) : <EOL> Thread . __init__ ( self ) <EOL> self . range = xrange ( int ( keys_per_thread * ( i + options . skipkeys ) ) , <EOL> keys_per_thread * ( i + <NUM_LIT:1> ) ) <EOL> self . idx = i <EOL> self . opcounts = opcounts <EOL> self . latencies = latencies <EOL> self . keycounts = keycounts <EOL> [ hostname ] = random . sample ( nodes , <NUM_LIT:1> ) <EOL> self . cclient = get_client ( hostname , options . port ) <EOL> self . cclient . transport . open ( ) <EOL> self . cclient . set_keyspace ( '<STR_LIT>' ) <EOL> class Inserter ( Operation ) : <EOL> def run ( self ) : <EOL> values = generate_values ( ) <EOL> columns = [ Column ( '<STR_LIT:C>' + str ( j ) , '<STR_LIT>' , time . time ( ) * <NUM_LIT> ) for j in xrange ( columns_per_key ) ] <EOL> if '<STR_LIT>' == options . cftype : <EOL> supers = [ SuperColumn ( '<STR_LIT:S>' + str ( j ) , columns ) for j in xrange ( supers_per_key ) ] <EOL> for i in self . range : <EOL> key = fmt % i <EOL> if '<STR_LIT>' == options . cftype : <EOL> cfmap = { key : { '<STR_LIT>' : [ Mutation ( ColumnOrSuperColumn ( super_column = s ) ) for s in supers ] } } <EOL> else : <EOL> cfmap = { key : { '<STR_LIT>' : [ Mutation ( ColumnOrSuperColumn ( column = c ) ) for c in columns ] } } <EOL> value = values [ i % len ( values ) ] <EOL> for column in columns : <EOL> column . value = value <EOL> start = time . time ( ) <EOL> try : <EOL> self . cclient . batch_mutate ( cfmap , consistency ) <EOL> except KeyboardInterrupt : <EOL> raise <EOL> except Exception , e : <EOL> if options . ignore : <EOL> print e <EOL> else : <EOL> raise <EOL> self . latencies [ self . idx ] += time . time ( ) - start <EOL> self . opcounts [ self . idx ] += <NUM_LIT:1> <EOL> self . keycounts [ self . idx ] += <NUM_LIT:1> <EOL> class Reader ( Operation ) : <EOL> def run ( self ) : <EOL> p = SlicePredicate ( slice_range = SliceRange ( '<STR_LIT>' , '<STR_LIT>' , False , columns_per_key ) ) <EOL> if '<STR_LIT>' == options . cftype : <EOL> for i in xrange ( keys_per_thread ) : <EOL> key = key_generator ( ) <EOL> for j in xrange ( supers_per_key ) : <EOL> parent = ColumnParent ( '<STR_LIT>' , '<STR_LIT:S>' + str ( j ) ) <EOL> start = time . time ( ) <EOL> try : <EOL> r = self . cclient . get_slice ( key , parent , p , consistency ) <EOL> if not r : raise RuntimeError ( "<STR_LIT>" % key ) <EOL> except KeyboardInterrupt : <EOL> raise <EOL> except Exception , e : <EOL> if options . ignore : <EOL> print e <EOL> else : <EOL> raise <EOL> self . latencies [ self . idx ] += time . time ( ) - start <EOL> self . opcounts [ self . idx ] += <NUM_LIT:1> <EOL> self . keycounts [ self . idx ] += <NUM_LIT:1> <EOL> else : <EOL> parent = ColumnParent ( '<STR_LIT>' ) <EOL> for i in xrange ( keys_per_thread ) : <EOL> key = key_generator ( ) <EOL> start = time . time ( ) <EOL> try : <EOL> r = self . cclient . get_slice ( key , parent , p , consistency ) <EOL> if not r : raise RuntimeError ( "<STR_LIT>" % key ) <EOL> except KeyboardInterrupt : <EOL> raise <EOL> except Exception , e : <EOL> if options . ignore : <EOL> print e <EOL> else : <EOL> raise <EOL> self . latencies [ self . idx ] += time . time ( ) - start <EOL> self . opcounts [ self . idx ] += <NUM_LIT:1> <EOL> self . keycounts [ self . idx ] += <NUM_LIT:1> <EOL> class RangeSlicer ( Operation ) : <EOL> def run ( self ) : <EOL> begin = self . range [ <NUM_LIT:0> ] <EOL> end = self . range [ - <NUM_LIT:1> ] <EOL> current = begin <EOL> last = current + options . rangecount <EOL> p = SlicePredicate ( slice_range = SliceRange ( '<STR_LIT>' , '<STR_LIT>' , False , columns_per_key ) ) <EOL> if '<STR_LIT>' == options . cftype : <EOL> while current < end : <EOL> keyrange = KeyRange ( fmt % current , fmt % last , count = options . rangecount ) <EOL> res = [ ] <EOL> for j in xrange ( supers_per_key ) : <EOL> parent = ColumnParent ( '<STR_LIT>' , '<STR_LIT:S>' + str ( j ) ) <EOL> begin = time . time ( ) <EOL> try : <EOL> res = self . cclient . get_range_slices ( parent , p , keyrange , consistency ) <EOL> if not res : raise RuntimeError ( "<STR_LIT>" % key ) <EOL> except KeyboardInterrupt : <EOL> raise <EOL> except Exception , e : <EOL> if options . ignore : <EOL> print e <EOL> else : <EOL> raise <EOL> self . latencies [ self . idx ] += time . time ( ) - begin <EOL> self . opcounts [ self . idx ] += <NUM_LIT:1> <EOL> current += len ( r ) + <NUM_LIT:1> <EOL> last = current + len ( r ) + <NUM_LIT:1> <EOL> self . keycounts [ self . idx ] += len ( r ) <EOL> else : <EOL> parent = ColumnParent ( '<STR_LIT>' ) <EOL> while current < end : <EOL> start = fmt % current <EOL> finish = fmt % last <EOL> keyrange = KeyRange ( start , finish , count = options . rangecount ) <EOL> begin = time . time ( ) <EOL> try : <EOL> r = self . cclient . get_range_slices ( parent , p , keyrange , consistency ) <EOL> if not r : raise RuntimeError ( "<STR_LIT>" , start , finish ) <EOL> except KeyboardInterrupt : <EOL> raise <EOL> except Exception , e : <EOL> if options . ignore : <EOL> print e <EOL> else : <EOL> print start , finish <EOL> raise <EOL> current += len ( r ) + <NUM_LIT:1> <EOL> last = current + len ( r ) + <NUM_LIT:1> <EOL> self . latencies [ self . idx ] += time . time ( ) - begin <EOL> self . opcounts [ self . idx ] += <NUM_LIT:1> <EOL> self . keycounts [ self . idx ] += len ( r ) <EOL> class IndexedRangeSlicer ( Operation ) : <EOL> def run ( self ) : <EOL> p = SlicePredicate ( slice_range = SliceRange ( '<STR_LIT>' , '<STR_LIT>' , False , columns_per_key ) ) <EOL> values = generate_values ( ) <EOL> parent = ColumnParent ( '<STR_LIT>' ) <EOL> expected_per_value = total_keys // len ( values ) <EOL> valuebegin = self . range [ <NUM_LIT:0> ] // expected_per_value <EOL> valuecount = len ( self . range ) // expected_per_value <EOL> for valueidx in xrange ( valuebegin , valuebegin + valuecount ) : <EOL> received = <NUM_LIT:0> <EOL> start = fmt % <NUM_LIT:0> <EOL> value = values [ valueidx % len ( values ) ] <EOL> expressions = [ IndexExpression ( column_name = '<STR_LIT>' , op = IndexOperator . EQ , value = value ) ] <EOL> while received < expected_per_value : <EOL> clause = IndexClause ( start_key = start , count = options . rangecount , expressions = expressions ) <EOL> begin = time . time ( ) <EOL> try : <EOL> r = self . cclient . get_indexed_slices ( parent , clause , p , consistency ) <EOL> if not r : raise RuntimeError ( "<STR_LIT>" , start ) <EOL> except KeyboardInterrupt : <EOL> raise <EOL> except Exception , e : <EOL> if options . ignore : <EOL> print e <EOL> continue <EOL> else : <EOL> raise <EOL> received += len ( r ) <EOL> start = fmt % ( <NUM_LIT:1> + max ( [ int ( keyslice . key ) for keyslice in r ] ) ) <EOL> self . latencies [ self . idx ] += time . time ( ) - begin <EOL> self . opcounts [ self . idx ] += <NUM_LIT:1> <EOL> self . keycounts [ self . idx ] += len ( r ) <EOL> class MultiGetter ( Operation ) : <EOL> def run ( self ) : <EOL> p = SlicePredicate ( slice_range = SliceRange ( '<STR_LIT>' , '<STR_LIT>' , False , columns_per_key ) ) <EOL> offset = self . idx * keys_per_thread <EOL> count = ( ( ( self . idx + <NUM_LIT:1> ) * keys_per_thread ) - offset ) / options . rangecount <EOL> if '<STR_LIT>' == options . cftype : <EOL> for x in xrange ( count ) : <EOL> keys = [ key_generator ( ) for i in xrange ( offset , offset + options . rangecount ) ] <EOL> for j in xrange ( supers_per_key ) : <EOL> parent = ColumnParent ( '<STR_LIT>' , '<STR_LIT:S>' + str ( j ) ) <EOL> start = time . time ( ) <EOL> try : <EOL> r = self . cclient . multiget_slice ( keys , parent , p , consistency ) <EOL> if not r : raise RuntimeError ( "<STR_LIT>" % keys ) <EOL> except KeyboardInterrupt : <EOL> raise <EOL> except Exception , e : <EOL> if options . ignore : <EOL> print e <EOL> else : <EOL> raise <EOL> self . latencies [ self . idx ] += time . time ( ) - start <EOL> self . opcounts [ self . idx ] += <NUM_LIT:1> <EOL> self . keycounts [ self . idx ] += len ( keys ) <EOL> offset += options . rangecount <EOL> else : <EOL> parent = ColumnParent ( '<STR_LIT>' ) <EOL> for x in xrange ( count ) : <EOL> keys = [ key_generator ( ) for i in xrange ( offset , offset + options . rangecount ) ] <EOL> start = time . time ( ) <EOL> try : <EOL> r = self . cclient . multiget_slice ( keys , parent , p , consistency ) <EOL> if not r : raise RuntimeError ( "<STR_LIT>" % keys ) <EOL> except KeyboardInterrupt : <EOL> raise <EOL> except Exception , e : <EOL> if options . ignore : <EOL> print e <EOL> else : <EOL> raise <EOL> self . latencies [ self . idx ] += time . time ( ) - start <EOL> self . opcounts [ self . idx ] += <NUM_LIT:1> <EOL> self . keycounts [ self . idx ] += len ( keys ) <EOL> offset += options . rangecount <EOL> class OperationFactory : <EOL> @ staticmethod <EOL> def create ( type , i , opcounts , keycounts , latencies ) : <EOL> if type == '<STR_LIT>' : <EOL> return Reader ( i , opcounts , keycounts , latencies ) <EOL> elif type == '<STR_LIT>' : <EOL> return Inserter ( i , opcounts , keycounts , latencies ) <EOL> elif type == '<STR_LIT>' : <EOL> return RangeSlicer ( i , opcounts , keycounts , latencies ) <EOL> elif type == '<STR_LIT>' : <EOL> return IndexedRangeSlicer ( i , opcounts , keycounts , latencies ) <EOL> elif type == '<STR_LIT>' : <EOL> return MultiGetter ( i , opcounts , keycounts , latencies ) <EOL> else : <EOL> raise RuntimeError , '<STR_LIT>' <EOL> class Stress ( object ) : <EOL> opcounts = array ( '<STR_LIT:i>' , [ <NUM_LIT:0> ] * n_threads ) <EOL> latencies = array ( '<STR_LIT:d>' , [ <NUM_LIT:0> ] * n_threads ) <EOL> keycounts = array ( '<STR_LIT:i>' , [ <NUM_LIT:0> ] * n_threads ) <EOL> def create_threads ( self , type ) : <EOL> threads = [ ] <EOL> for i in xrange ( n_threads ) : <EOL> th = OperationFactory . create ( type , i , self . opcounts , self . keycounts , self . latencies ) <EOL> threads . append ( th ) <EOL> th . start ( ) <EOL> return threads <EOL> def run_test ( self , filename , threads ) : <EOL> start_t = time . time ( ) <EOL> if filename : <EOL> outf = open ( filename , '<STR_LIT:w>' ) <EOL> else : <EOL> outf = sys . stdout <EOL> outf . write ( '<STR_LIT>' ) <EOL> epoch = total = old_total = latency = keycount = old_keycount = old_latency = <NUM_LIT:0> <EOL> epoch_intervals = ( options . interval * <NUM_LIT:10> ) <EOL> terminate = False <EOL> while not terminate : <EOL> time . sleep ( <NUM_LIT:0.1> ) <EOL> if not [ th for th in threads if th . isAlive ( ) ] : <EOL> terminate = True <EOL> epoch = epoch + <NUM_LIT:1> <EOL> if terminate or epoch > epoch_intervals : <EOL> epoch = <NUM_LIT:0> <EOL> old_total , old_latency , old_keycount = total , latency , keycount <EOL> total = sum ( self . opcounts [ th . idx ] for th in threads ) <EOL> latency = sum ( self . latencies [ th . idx ] for th in threads ) <EOL> keycount = sum ( self . keycounts [ th . idx ] for th in threads ) <EOL> opdelta = total - old_total <EOL> keydelta = keycount - old_keycount <EOL> delta_latency = latency - old_latency <EOL> if opdelta > <NUM_LIT:0> : <EOL> delta_formatted = ( delta_latency / opdelta ) <EOL> else : <EOL> delta_formatted = '<STR_LIT>' <EOL> elapsed_t = int ( time . time ( ) - start_t ) <EOL> outf . write ( '<STR_LIT>' <EOL> % ( total , opdelta / options . interval , keydelta / options . interval , delta_formatted , elapsed_t ) ) <EOL> def insert ( self ) : <EOL> threads = self . create_threads ( '<STR_LIT>' ) <EOL> self . run_test ( options . file , threads ) ; <EOL> def read ( self ) : <EOL> threads = self . create_threads ( '<STR_LIT>' ) <EOL> self . run_test ( options . file , threads ) ; <EOL> def rangeslice ( self ) : <EOL> threads = self . create_threads ( '<STR_LIT>' ) <EOL> self . run_test ( options . file , threads ) ; <EOL> def indexedrangeslice ( self ) : <EOL> threads = self . create_threads ( '<STR_LIT>' ) <EOL> self . run_test ( options . file , threads ) ; <EOL> def multiget ( self ) : <EOL> threads = self . create_threads ( '<STR_LIT>' ) <EOL> self . run_test ( options . file , threads ) ; <EOL> stresser = Stress ( ) <EOL> benchmark = getattr ( stresser , options . operation , None ) <EOL> if not have_multiproc : <EOL> print """<STR_LIT>""" <EOL> if options . operation == '<STR_LIT>' : <EOL> make_keyspaces ( ) <EOL> benchmark ( ) </s>
