Skip to content

Commit

Permalink
chore: Generate traffic
Browse files Browse the repository at this point in the history
  • Loading branch information
NSSPKrishna committed Jan 31, 2024
1 parent 93e6cf5 commit 5faa1fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import requests
import time
import uuid
from flask import Flask, jsonify, request
from flask_cors import CORS
Expand Down Expand Up @@ -85,5 +87,12 @@ def single_book(book_id):
def somefunction():
return jsonify('Posted')

def generate_traffic():
while True:
requests.get('http://localhost:5000/books')
requests.get('http://localhost:5000/ping')
time.sleep(60)

if __name__ == '__main__':
app.run()
app.run(threaded=True)
generate_traffic()
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Flask>=2.2.2
Flask-Cors==3.0.10
requests==2.28.1

0 comments on commit 5faa1fe

Please sign in to comment.