Correct one more int/float mixage
Also, pull the change into the JSON parser for consistency. Related to issue #12
This commit is contained in:
parent
fcbcbf4ef7
commit
9ccfeb8181
2 changed files with 10 additions and 8 deletions
|
@ -231,7 +231,7 @@ def history_ping_stats(parse_samples, verbose=False):
|
||||||
count_unsched += 1
|
count_unsched += 1
|
||||||
total_unsched_drop += d
|
total_unsched_drop += d
|
||||||
if d >= 1:
|
if d >= 1:
|
||||||
count_full_unsched += d
|
count_full_unsched += 1
|
||||||
# scheduled=false and obstructed=true do not ever appear to overlap,
|
# scheduled=false and obstructed=true do not ever appear to overlap,
|
||||||
# but in case they do in the future, treat that as just unscheduled
|
# but in case they do in the future, treat that as just unscheduled
|
||||||
# in order to avoid double-counting it.
|
# in order to avoid double-counting it.
|
||||||
|
|
|
@ -100,13 +100,13 @@ def history_ping_stats(filename, parse_samples, verbose=False):
|
||||||
# index to next data sample after the newest one.
|
# index to next data sample after the newest one.
|
||||||
offset = current % samples
|
offset = current % samples
|
||||||
|
|
||||||
tot = 0
|
tot = 0.0
|
||||||
count_full_drop = 0
|
count_full_drop = 0
|
||||||
count_unsched = 0
|
count_unsched = 0
|
||||||
total_unsched_drop = 0
|
total_unsched_drop = 0.0
|
||||||
count_full_unsched = 0
|
count_full_unsched = 0
|
||||||
count_obstruct = 0
|
count_obstruct = 0
|
||||||
total_obstruct_drop = 0
|
total_obstruct_drop = 0.0
|
||||||
count_full_obstruct = 0
|
count_full_obstruct = 0
|
||||||
|
|
||||||
second_runs = [0] * 60
|
second_runs = [0] * 60
|
||||||
|
@ -126,9 +126,10 @@ def history_ping_stats(filename, parse_samples, verbose=False):
|
||||||
|
|
||||||
for i in sample_range:
|
for i in sample_range:
|
||||||
d = history["popPingDropRate"][i]
|
d = history["popPingDropRate"][i]
|
||||||
tot += d
|
|
||||||
if d >= 1:
|
if d >= 1:
|
||||||
count_full_drop += d
|
# just in case...
|
||||||
|
d = 1
|
||||||
|
count_full_drop += 1
|
||||||
run_length += 1
|
run_length += 1
|
||||||
elif run_length > 0:
|
elif run_length > 0:
|
||||||
if init_run_length is None:
|
if init_run_length is None:
|
||||||
|
@ -145,7 +146,7 @@ def history_ping_stats(filename, parse_samples, verbose=False):
|
||||||
count_unsched += 1
|
count_unsched += 1
|
||||||
total_unsched_drop += d
|
total_unsched_drop += d
|
||||||
if d >= 1:
|
if d >= 1:
|
||||||
count_full_unsched += d
|
count_full_unsched += 1
|
||||||
# scheduled=false and obstructed=true do not ever appear to overlap,
|
# scheduled=false and obstructed=true do not ever appear to overlap,
|
||||||
# but in case they do in the future, treat that as just unscheduled
|
# but in case they do in the future, treat that as just unscheduled
|
||||||
# in order to avoid double-counting it.
|
# in order to avoid double-counting it.
|
||||||
|
@ -153,7 +154,8 @@ def history_ping_stats(filename, parse_samples, verbose=False):
|
||||||
count_obstruct += 1
|
count_obstruct += 1
|
||||||
total_obstruct_drop += d
|
total_obstruct_drop += d
|
||||||
if d >= 1:
|
if d >= 1:
|
||||||
count_full_obstruct += d
|
count_full_obstruct += 1
|
||||||
|
tot += d
|
||||||
|
|
||||||
# If the entire sample set is one big drop run, it will be both initial
|
# If the entire sample set is one big drop run, it will be both initial
|
||||||
# fragment (continued from prior sample range) and final one (continued
|
# fragment (continued from prior sample range) and final one (continued
|
||||||
|
|
Loading…
Reference in a new issue