feat: WebSocket upload (one TCP, no Cilium cycling), bump 1.0.9→1.0.10
Deploy loadtest / validate (push) Waiting to run

This commit is contained in:
2026-07-10 23:51:25 +04:00
parent 74e64b312a
commit ea04bcb7cd
4 changed files with 126 additions and 62 deletions
+28 -1
View File
@@ -1,10 +1,37 @@
import time
import json
import base64
from flask import Flask, render_template, request
from flask_sock import Sock
app = Flask(__name__)
sock = Sock(app)
VERSION = '1.0.9'
VERSION = '1.0.10'
@app.route('/')
def index():
return render_template('index.html', version=VERSION)
@app.route('/health')
def health():
return {'ok': True, 'version': VERSION}
@sock.route('/ws-upload')
def ws_upload(ws):
"""WebSocket: получает чанки, считает байты и время"""
t0 = time.time()
total = 0
while True:
chunk = ws.receive()
if chunk is None:
break
total += len(chunk)
elapsed = round((time.time() - t0) * 1000)
ws.send(json.dumps({'ok': True, 'bytes': total, 'elapsed_ms': elapsed}))
@app.route('/')