Files
loadtest/site/app.py
T
naeel ee972377a5
Deploy loadtest / validate (push) Waiting to run
feat: favicon.svg, иконка в topbar, v1.0.1
2026-07-10 08:09:36 +04:00

35 lines
726 B
Python

import time
from flask import Flask, render_template, request
app = Flask(__name__)
VERSION = '1.0.1'
@app.route('/')
def index():
return render_template('index.html', version=VERSION)
@app.route('/health')
def health():
return {'ok': True, 'version': VERSION}
@app.route('/upload', methods=['POST'])
def upload():
t0 = time.time()
total = 0
for f in request.files.values():
while True:
chunk = f.read(8192)
if not chunk:
break
total += len(chunk)
elapsed = round((time.time() - t0) * 1000)
return {'ok': True, 'bytes': total, 'elapsed_ms': elapsed}
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)