<s> from locust import task , TaskSet <EOL> class EC2Read ( TaskSet ) : <EOL> @ task ( <NUM_LIT:10> ) <EOL> def get_instances ( self ) : <EOL> self . client . time_operation ( self . client . get_instances ) <EOL> @ task ( <NUM_LIT:10> ) <EOL> def get_volumes ( self ) : <EOL> self . client . time_operation ( self . client . get_volumes ) <EOL> class EC2Create ( TaskSet ) : <EOL> @ task ( <NUM_LIT:1> ) <EOL> def run_instances ( self ) : <EOL> reservation = self . client . time_operation ( self . client . run_instance ) <EOL> self . client . time_operation ( self . client . terminate_instances , reservation ) <EOL> @ task ( <NUM_LIT:1> ) <EOL> def create_volumes ( self ) : <EOL> volumes = self . client . time_operation ( self . client . create_volumes , <EOL> zone = "<STR_LIT>" ) <EOL> self . client . time_operation ( self . client . delete_volumes , volumes ) <EOL> class S3Operations ( TaskSet ) : <EOL> @ task ( <NUM_LIT:10> ) <EOL> def list_buckets ( self ) : <EOL> self . client . time_operation ( self . client . s3 . get_all_buckets ) <EOL> @ task ( <NUM_LIT:1> ) <EOL> def create_bucket ( self ) : <EOL> bucket = self . client . time_operation ( self . client . s3 . create_bucket , <EOL> str ( int ( time . time ( ) ) ) . <EOL> lower ( ) ) <EOL> if bucket : <EOL> self . client . time_operation ( self . client . s3 . delete_bucket , bucket ) </s>
