Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

postscreen_stats: pep8 cleanup

  • Loading branch information...
commit b7068b39a86c4af4d5a3394a7d6f8e90337f1d08 1 parent 28c9054
Julien Vehent authored
Showing with 22 additions and 11 deletions.
  1. +22 −11 postscreen_stats.py
View
33 postscreen_stats.py
@@ -407,7 +407,8 @@ def action_filter(self,filter):
print clients[stat],stat
print "\n=== First reconnection delay (graylist) ==="
- print "delay| <10s |>10to30s| >30to1m| >1to5m | >5to30m|>30mto2h| >2hto5h|>5hto12h|>12to24h| >24h |";
+ print "delay| <10s |>10to30s| >30to1m| >1to5m | >5to30m|" + \
+ ">30mto2h| >2hto5h|>5hto12h|>12to24h| >24h |"
# display the absolute values
sys.stdout.write("count|")
sys.stdout.write(str(comeback['<10s']).ljust(8) + "|")
@@ -427,16 +428,26 @@ def action_filter(self,filter):
dec_cameback = Decimal(clients["reconnections"])
sys.stdout.write(" % |")
- sys.stdout.write(str(Decimal(comeback['<10s'])/dec_cameback * 100).ljust(8) + "|")
- sys.stdout.write(str(Decimal(comeback['>10s to 30s'])/dec_cameback * 100).ljust(8) + "|")
- sys.stdout.write(str(Decimal(comeback['>30s to 1min'])/dec_cameback * 100).ljust(8) + "|")
- sys.stdout.write(str(Decimal(comeback['>1min to 5min'])/dec_cameback * 100).ljust(8) + "|")
- sys.stdout.write(str(Decimal(comeback['>5 min to 30min'])/dec_cameback * 100).ljust(8) + "|")
- sys.stdout.write(str(Decimal(comeback['>30min to 2h'])/dec_cameback * 100).ljust(8) + "|")
- sys.stdout.write(str(Decimal(comeback['>2h to 5h'])/dec_cameback * 100).ljust(8) + "|")
- sys.stdout.write(str(Decimal(comeback['>5h to 12h'])/dec_cameback * 100).ljust(8) + "|")
- sys.stdout.write(str(Decimal(comeback['>12h to 24h'])/dec_cameback * 100).ljust(8) + "|")
- print str(Decimal(comeback['>24h'])/dec_cameback * 100).ljust(8) + "|"
+ sys.stdout.write(str(Decimal(comeback['<10s'])\
+ /dec_cameback * 100).ljust(8) + "|")
+ sys.stdout.write(str(Decimal(comeback['>10s to 30s'])\
+ /dec_cameback * 100).ljust(8) + "|")
+ sys.stdout.write(str(Decimal(comeback['>30s to 1min'])\
+ /dec_cameback * 100).ljust(8) + "|")
+ sys.stdout.write(str(Decimal(comeback['>1min to 5min'])\
+ /dec_cameback * 100).ljust(8) + "|")
+ sys.stdout.write(str(Decimal(comeback['>5 min to 30min'])\
+ /dec_cameback * 100).ljust(8) + "|")
+ sys.stdout.write(str(Decimal(comeback['>30min to 2h'])\
+ /dec_cameback * 100).ljust(8) + "|")
+ sys.stdout.write(str(Decimal(comeback['>2h to 5h'])\
+ /dec_cameback * 100).ljust(8) + "|")
+ sys.stdout.write(str(Decimal(comeback['>5h to 12h'])\
+ /dec_cameback * 100).ljust(8) + "|")
+ sys.stdout.write(str(Decimal(comeback['>12h to 24h'])\
+ /dec_cameback * 100).ljust(8) + "|")
+ print str(Decimal(comeback['>24h'])\
+ /dec_cameback * 100).ljust(8) + "|"
if GEOLOC > 0:
total_blocked = Decimal(clients["blocked clients"])
Please sign in to comment.
Something went wrong with that request. Please try again.