mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-01 23:30:53 +00:00
munin/tahoe_spacetime: show 2wk data even if 4wk data is unavailable
This commit is contained in:
parent
914783acdf
commit
315a89f9d8
@ -44,10 +44,14 @@ def predict_future(past_s):
|
|||||||
# point = points[0]
|
# point = points[0]
|
||||||
# print point
|
# print point
|
||||||
start_space = d[2][0][0]
|
start_space = d[2][0][0]
|
||||||
|
if start_space is None:
|
||||||
|
return None
|
||||||
# I don't know why, but the last few points are always bogus. Running
|
# I don't know why, but the last few points are always bogus. Running
|
||||||
# 'rrdtool fetch' on the command line is usually ok.. I blame the python
|
# 'rrdtool fetch' on the command line is usually ok.. I blame the python
|
||||||
# bindinds.
|
# bindinds.
|
||||||
end_space = d[2][-4][0]
|
end_space = d[2][-4][0]
|
||||||
|
if end_space is None:
|
||||||
|
return None
|
||||||
end_time = end_time - (4*step)
|
end_time = end_time - (4*step)
|
||||||
start_df.append(start_space)
|
start_df.append(start_space)
|
||||||
end_df.append(end_space)
|
end_df.append(end_space)
|
||||||
@ -91,10 +95,14 @@ days_4wk.draw LINE2"""
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
#rsync_rrd()
|
#rsync_rrd()
|
||||||
|
samples = {}
|
||||||
remaining_4wk = predict_future("4wk")
|
remaining_4wk = predict_future("4wk")
|
||||||
|
if remaining_4wk is not None:
|
||||||
|
print "days_4wk.value", remaining_4wk
|
||||||
|
samples["remaining_4wk"] = remaining_4wk
|
||||||
remaining_2wk = predict_future("2wk")
|
remaining_2wk = predict_future("2wk")
|
||||||
print "days_4wk.value", remaining_4wk
|
if remaining_2wk is not None:
|
||||||
print "days_2wk.value", remaining_2wk
|
print "days_2wk.value", remaining_2wk
|
||||||
write_to_file({"remaining_2wk": remaining_2wk,
|
samples["remaining_2wk"] = remaining_2wk
|
||||||
"remaining_4wk": remaining_4wk})
|
write_to_file(samples)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user