Skip to content

Commit 621c4c3

Browse files
committed
feat: update BNetzA demo data to realistic 1 Gbit cable values
Based on real breitbandmessung.de CSV exports (Desktop App + Web Test). Tariff: Vodafone GigaZuhause 1000 Kabel (1000/850/600 DL, 50/35/15 UL). Good campaigns: 850-980 Mbit/s DL, bad campaigns: 450-600 Mbit/s DL.
1 parent c692bc0 commit 621c4c3

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

app/collectors/demo.py

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -643,12 +643,20 @@ def _seed_bqm_graphs(self, now):
643643
log.info("Demo: seeded 30 BQM graphs")
644644

645645
def _seed_bnetz_measurements(self, now):
646-
"""Seed 9 BNetzA measurement campaigns over 9 months (matching 250/40 Cable tariff)."""
646+
"""Seed 9 BNetzA measurement campaigns over 9 months.
647+
648+
Based on real Vodafone GigaZuhause 1000 Kabel tariff values
649+
from breitbandmessung.de Desktop App and Web Test exports.
650+
"""
647651
# Campaign dates: roughly monthly, spread over the demo period
648652
campaign_offsets_days = [250, 220, 190, 160, 130, 100, 70, 40, 10]
649653
# Campaigns where download shows deviation (correlate with bad signal periods)
650654
bad_campaigns = {2, 5, 7} # indices into campaign_offsets_days
651655

656+
# Tariff values from real Desktop App CSV (GigaZuhause 1000 Kabel Nov 2023)
657+
dl_max, dl_normal, dl_min = 1000.0, 850.0, 600.0
658+
ul_max, ul_normal, ul_min = 50.0, 35.0, 15.0
659+
652660
rows = []
653661
for idx, offset in enumerate(campaign_offsets_days):
654662
campaign_date = now - timedelta(days=offset)
@@ -662,11 +670,13 @@ def _seed_bnetz_measurements(self, now):
662670
for m in range(5):
663671
m_date = campaign_date + timedelta(days=m)
664672
if is_bad:
665-
dl = round(random.uniform(150, 185), 2)
666-
ul = round(random.uniform(28, 38), 2)
673+
# Below normal: realistic cable degradation (450-600 Mbit/s)
674+
dl = round(random.uniform(450, 600), 2)
675+
ul = round(random.uniform(30, 45), 2)
667676
else:
668-
dl = round(random.uniform(200, 250), 2)
669-
ul = round(random.uniform(30, 40), 2)
677+
# Normal operation: realistic 1 Gbit cable (850-980 Mbit/s)
678+
dl = round(random.uniform(850, 980), 2)
679+
ul = round(random.uniform(40, 55), 2)
670680
dl_values.append(dl)
671681
ul_values.append(ul)
672682
measurements_dl.append({
@@ -681,10 +691,9 @@ def _seed_bnetz_measurements(self, now):
681691
dl_avg = round(sum(dl_values) / len(dl_values), 2)
682692
ul_avg = round(sum(ul_values) / len(ul_values), 2)
683693

684-
# BNetzA verdicts: "ok" or "deviation"
685-
# Deviation if avg < normal (200 for DL, 30 for UL)
686-
verdict_dl = "deviation" if dl_avg < 200 else "ok"
687-
verdict_ul = "deviation" if ul_avg < 30 else "ok"
694+
# BNetzA verdicts based on tariff normal thresholds
695+
verdict_dl = "deviation" if dl_avg < dl_normal else "ok"
696+
verdict_ul = "deviation" if ul_avg < ul_normal else "ok"
688697

689698
measurements_json = json.dumps({
690699
"download": measurements_dl,
@@ -694,14 +703,14 @@ def _seed_bnetz_measurements(self, now):
694703
rows.append((
695704
campaign_date.strftime("%Y-%m-%d"),
696705
campaign_date.strftime("%Y-%m-%dT%H:%M:%SZ"),
697-
"Vodafone Kabel", # provider
698-
"Cable 250", # tariff
699-
250.0, # download_max_tariff
700-
200.0, # download_normal_tariff
701-
150.0, # download_min_tariff
702-
40.0, # upload_max_tariff
703-
30.0, # upload_normal_tariff
704-
10.0, # upload_min_tariff
706+
"Vodafone Kabel", # provider
707+
"GigaZuhause 1000 Kabel Nov 2023", # tariff
708+
dl_max, # download_max_tariff
709+
dl_normal, # download_normal_tariff
710+
dl_min, # download_min_tariff
711+
ul_max, # upload_max_tariff
712+
ul_normal, # upload_normal_tariff
713+
ul_min, # upload_min_tariff
705714
dl_avg, # download_measured_avg
706715
ul_avg, # upload_measured_avg
707716
5, # measurement_count

0 commit comments

Comments
 (0)