From f11b82668457ef763338eda345014c3fd294cc76 Mon Sep 17 00:00:00 2001 From: sparky8512 <76499194+sparky8512@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:52:21 -0800 Subject: [PATCH] Port recent changes from starlink_grpc.py This brings the fix for the protocol changes that removed some of the history fields into the JSON version of this module. I'm really only bothering with this because the script that uses it is mentioned in the project README, which I am in the process of updating. --- starlink_json.py | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/starlink_json.py b/starlink_json.py index a67713c..70cfc20 100644 --- a/starlink_json.py +++ b/starlink_json.py @@ -192,9 +192,6 @@ def history_bulk_data(filename, parse_samples, verbose=False): pop_ping_latency_ms = [] downlink_throughput_bps = [] uplink_throughput_bps = [] - snr = [] - scheduled = [] - obstructed = [] for i in sample_range: pop_ping_drop_rate.append(history["popPingDropRate"][i]) @@ -202,9 +199,6 @@ def history_bulk_data(filename, parse_samples, verbose=False): history["popPingLatencyMs"][i] if history["popPingDropRate"][i] < 1 else None) downlink_throughput_bps.append(history["downlinkThroughputBps"][i]) uplink_throughput_bps.append(history["uplinkThroughputBps"][i]) - snr.append(history["snr"][i]) - scheduled.append(history["scheduled"][i]) - obstructed.append(history["obstructed"][i]) return { "samples": parsed_samples, @@ -214,9 +208,9 @@ def history_bulk_data(filename, parse_samples, verbose=False): "pop_ping_latency_ms": pop_ping_latency_ms, "downlink_throughput_bps": downlink_throughput_bps, "uplink_throughput_bps": uplink_throughput_bps, - "snr": snr, - "scheduled": scheduled, - "obstructed": obstructed, + "snr": [None] * parsed_samples, # obsoleted in grpc service + "scheduled": [None] * parsed_samples, # obsoleted in grpc service + "obstructed": [None] * parsed_samples, # obsoleted in grpc service } @@ -299,19 +293,6 @@ def history_stats(filename, parse_samples, verbose=False): run_length = 0 elif init_run_length is None: init_run_length = 0 - if not history["scheduled"][i]: - count_unsched += 1 - total_unsched_drop += d - if d >= 1: - count_full_unsched += 1 - # scheduled=false and obstructed=true do not ever appear to overlap, - # but in case they do in the future, treat that as just unscheduled - # in order to avoid double-counting it. - elif history["obstructed"][i]: - count_obstruct += 1 - total_obstruct_drop += d - if d >= 1: - count_full_obstruct += 1 tot += d down = history["downlinkThroughputBps"][i]