locustでやってるシナリオは次の通り. 1. カタログ一覧を取得 2. カタログの中から一つアイテムをランダムで選ぶ 3. トップページを閲覧 4. トップページから/loginへログイン処理 5. ログイン後,カテゴリページを閲覧 6. カテゴリページの中からランダムで選んだアイテムの詳細ページを閲覧 7. ログインユーザのカートの中身を削除 8. ランダム選択したアイテムをカートに追加する 9. バスケットページを閲覧 10. 注文する ```python class WebTasks(TaskSet): @task def load(self): base64string = base64.encodestring('%s:%s' % ('user', 'password')).replace('\n', '') catalogue = self.client.get("/catalogue").json() category_item = choice(catalogue) item_id = category_item["id"] self.client.get("/") self.client.get("/login", headers={"Authorization":"Basic %s" % base64string}) self.client.get("/category.html") self.client.get("/detail.html?id={}".format(item_id)) self.client.delete("/cart") self.client.post("/cart", json={"id": item_id, "quantity": 1}) self.client.get("/basket.html") self.client.post("/orders") ``` [https://github.com/microservices-demo/load-test/blob/57a8828/locustfile.py#L13-L24](https://github.com/microservices-demo/load-test/blob/57a8828/locustfile.py#L13-L24)