From acef7eb6104d8bc0e532322471d5bb62c3dbb15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Mon, 3 Nov 2025 09:53:30 +0100 Subject: [PATCH] new options --- utils/stats_utils.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/stats_utils.py b/utils/stats_utils.py index fd0f3b8..24b6067 100644 --- a/utils/stats_utils.py +++ b/utils/stats_utils.py @@ -51,24 +51,24 @@ def parse_haproxy_stats(stats_data): try: bin_bytes = float(row.get('bin', 0) or 0) - bytes_in_mb = f'{bin_bytes / (1024 * 1024):.2f}' + bytes_in_mb = bin_bytes / (1024 * 1024) # ✅ FLOAT, nie string! except (ValueError, TypeError): - bytes_in_mb = '0.00' + bytes_in_mb = 0.0 try: bout_bytes = float(row.get('bout', 0) or 0) - bytes_out_mb = f'{bout_bytes / (1024 * 1024):.2f}' + bytes_out_mb = bout_bytes / (1024 * 1024) # ✅ FLOAT, nie string! except (ValueError, TypeError): - bytes_out_mb = '0.00' + bytes_out_mb = 0.0 data.append({ 'frontend_name': row.get('pxname', 'Unknown'), 'server_name': row.get('svname', 'Unknown'), '4xx_errors': hrsp_4xx, '5xx_errors': hrsp_5xx, - 'bytes_in_mb': bytes_in_mb, - 'bytes_out_mb': bytes_out_mb, - 'conn_tot': conn_tot, # ✅ Teraz INT + 'bytes_in_mb': bytes_in_mb, # ✅ Float + 'bytes_out_mb': bytes_out_mb, # ✅ Float + 'conn_tot': conn_tot, # ✅ Int }) return data