From a5036db9e09aff3bb2616915b76f01cd2e2c7566 Mon Sep 17 00:00:00 2001 From: sparky8512 <76499194+sparky8512@users.noreply.github.com> Date: Wed, 30 Dec 2020 13:09:24 -0800 Subject: [PATCH] Don't allow a sample to be both unscheduled and obstructed Doesn't ever seem to happen, but in case it does in the future, treat that case as just unscheduled. This way, the unclassified ping loss (AKA "Beta downtime") can be computed from the totals. --- dishHistoryStats.py | 5 ++++- parseJsonHistory.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dishHistoryStats.py b/dishHistoryStats.py index 5dd1a51..1a11d78 100644 --- a/dishHistoryStats.py +++ b/dishHistoryStats.py @@ -150,7 +150,10 @@ for i in sampleRange: totUnschedD += d if d >= 1: totUnschedOne += d - if historyData.obstructed[i]: + # 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 historyData.obstructed[i]: totObstruct += 1 totObstructD += d if d >= 1: diff --git a/parseJsonHistory.py b/parseJsonHistory.py index b7a993d..0817914 100644 --- a/parseJsonHistory.py +++ b/parseJsonHistory.py @@ -153,7 +153,10 @@ for i in sampleRange: totUnschedD += d if d >= 1: totUnschedOne += d - if historyData["obstructed"][i]: + # 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 historyData["obstructed"][i]: totObstruct += 1 totObstructD += d if d >= 1: