<s> import uuid <EOL> from datetime import datetime <EOL> from locust import HttpLocust , TaskSet , task <EOL> class MetricsTaskSet ( TaskSet ) : <EOL> _deviceid = None <EOL> def on_start ( self ) : <EOL> self . _deviceid = str ( uuid . uuid4 ( ) ) <EOL> @ task ( <NUM_LIT:1> ) <EOL> def login ( self ) : <EOL> self . client . post ( <EOL> '<STR_LIT>' , { "<STR_LIT>" : self . _deviceid } ) <EOL> @ task ( <NUM_LIT> ) <EOL> def post_metrics ( self ) : <EOL> self . client . post ( <EOL> "<STR_LIT>" , { "<STR_LIT>" : self . _deviceid , "<STR_LIT>" : datetime . now ( ) } ) <EOL> class MetricsLocust ( HttpLocust ) : <EOL> task_set = MetricsTaskSet </s>
