Skip to content

Commit

Permalink
update stats every 5 minutes, and reduce munin timeout to 6min
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Jun 17, 2018
1 parent c3aa82d commit 4830c8b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion misc/munin/wormhole_active
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ channel_db = sqlite3.connect(channeldbfile)

MINUTE = 60.0
updated,rebooted = usage_db.execute("SELECT `updated`,`rebooted` FROM `current`").fetchone()
if time.time() > updated + 11*MINUTE:
if time.time() > updated + 6*MINUTE:
sys.exit(1) # expired

nameplates = channel_db.execute("SELECT COUNT() FROM `nameplates`").fetchone()[0]
Expand Down
2 changes: 1 addition & 1 deletion misc/munin/wormhole_errors
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ usage_db = sqlite3.connect(usagedbfile)

MINUTE = 60.0
updated,rebooted = usage_db.execute("SELECT `updated`,`rebooted` FROM `current`").fetchone()
if time.time() > updated + 11*MINUTE:
if time.time() > updated + 6*MINUTE:
sys.exit(1) # expired

r1 = usage_db.execute("SELECT COUNT() FROM `nameplates`").fetchone()[0]
Expand Down
2 changes: 1 addition & 1 deletion misc/munin/wormhole_event_rate
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ usage_db = sqlite3.connect(usagedbfile)

MINUTE = 60.0
updated,rebooted = usage_db.execute("SELECT `updated`,`rebooted` FROM `current`").fetchone()
if time.time() > updated + 11*MINUTE:
if time.time() > updated + 6*MINUTE:
sys.exit(1) # expired

atm = defaultdict(int)
Expand Down
2 changes: 1 addition & 1 deletion misc/munin/wormhole_events
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ usage_db = sqlite3.connect(usagedbfile)
MINUTE = 60.0
updated,rebooted,blur = usage_db.execute(
"SELECT `updated`,`rebooted`,`blur_time` FROM `current`").fetchone()
if time.time() > updated + 11*MINUTE:
if time.time() > updated + 6*MINUTE:
sys.exit(1) # expired
if blur is not None:
rebooted = blur * (rebooted // blur)
Expand Down
2 changes: 1 addition & 1 deletion misc/munin/wormhole_events_alltime
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ usage_db = sqlite3.connect(usagedbfile)

MINUTE = 60.0
updated,rebooted = usage_db.execute("SELECT `updated`,`rebooted` FROM `current`").fetchone()
if time.time() > updated + 11*MINUTE:
if time.time() > updated + 6*MINUTE:
sys.exit(1) # expired

for mood in ["happy", "scary", "lonely", "errory", "pruney", "crowded"]:
Expand Down
2 changes: 1 addition & 1 deletion src/wormhole_mailbox_server/server_tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def opt_websocket_protocol_option(self, arg):

# CHANNEL_EXPIRATION_TIME should be longer than EXPIRATION_CHECK_PERIOD
CHANNEL_EXPIRATION_TIME = 11*MINUTE
EXPIRATION_CHECK_PERIOD = 10*MINUTE
EXPIRATION_CHECK_PERIOD = 5*MINUTE

def makeService(config, channel_db="relay.sqlite", reactor=reactor):
increase_rlimits()
Expand Down

0 comments on commit 4830c8b

Please sign in to comment.