feat: WS ACK + 8KB chunks (below kube-vip 50KB threshold), bump 1.0.21
Deploy loadtest / validate (push) Waiting to run

This commit is contained in:
2026-07-11 10:01:06 +04:00
parent 0a76457efd
commit a6b3e267b1
2 changed files with 67 additions and 41 deletions
+3 -2
View File
@@ -6,7 +6,7 @@ from flask_sock import Sock
app = Flask(__name__)
sock = Sock(app)
VERSION = '1.0.20'
VERSION = '1.0.21'
@app.route('/')
@@ -21,7 +21,7 @@ def health():
@sock.route('/ws-upload')
def ws_upload(ws):
"""WebSocket: получает чанки, считает байты и время"""
"""WebSocket: получает чанки, ACK после каждого"""
t0 = time.time()
total = 0
while True:
@@ -31,6 +31,7 @@ def ws_upload(ws):
if isinstance(chunk, str) and chunk == 'DONE':
break
total += len(chunk)
ws.send(json.dumps({'ack': total}))
elapsed = round((time.time() - t0) * 1000)
ws.send(json.dumps({'ok': True, 'bytes': total, 'elapsed_ms': elapsed}))