Commits

Peter Nixon  committed 5f8fe62

Fix sleep option and tweak some of the display columns

  • Participants
  • Parent commits f6b05a5

Comments (0)

Files changed (1)

     logQueue = multiprocessing.Queue()
     
     for filepath in files:
-        p = multiprocessing.Process(target=logWorker, args=(filepath, logQueue, options.code))
+        p = multiprocessing.Process(target=logWorker, args=(filepath, logQueue, options.code, options.sleep))
         p.daemon = True
         p.start()
 
                     percent_503 = float(status_counter[503]) / float(total_requests) * 100
                     percent_504 = float(status_counter[504]) / float(total_requests) * 100
                     rootwin.border(0)
-                    rootwin.addstr(1, 1, "#  Hits      Site                          Gateway Timeout  Service unavailable")
-                    rootwin.addstr(height - 2, 1, "Sites: %d  Req: %d  Bypass: %d (%f%%) 503 Err: %d (%f%%) 504 Err: %d (%f%%)" % (len(host_counter), total_requests, bypassed_requests, bypass_percent, status_counter[503], percent_503, status_counter[504], percent_504))
+                    rootwin.addstr(1, 1, "#  Hits      Site                          HTTP 503  HTTP 504")
+                    rootwin.addstr(height - 2, 1, "Sites: %d  Req: %d  Bypass: %d (%.3f%%) Err 503: %d (%.3f%%) Err 504: %d (%.3f%%)" % (len(host_counter), total_requests, bypassed_requests, bypass_percent, status_counter[503], percent_503, status_counter[504], percent_504))
                     rootwin.hline(2, 1, curses.ACS_HLINE, width)
                     n = 1
                     y = 3
                         #    rootwin.addstr(y, 40, str(key2))
                         host_percent_503 = float(status_dict[key][503]) / float(total_requests) * 100
                         host_percent_504 = float(status_dict[key][504]) / float(total_requests) * 100
-                        rootwin.addstr(y, 44, "%f%% (%d)" % (host_percent_503, status_dict[key][503]))
-                        rootwin.addstr(y, 61, "%f%% (%d)" % (host_percent_504, status_dict[key][504]))
+                        rootwin.addstr(y, 44, "%.3f%%" % (host_percent_503))
+                        rootwin.addstr(y, 54, "%.3f%%" % (host_percent_504))
                         n += 1
                         y += 1
                     nextrefresh = int(time.time()) + refreshinterval
     parser.add_option('-r', '--refresh', dest='refresh', default=5, type='int',
                       help='screen refresh interval')
 
-    parser.add_option('-s', '--sleep-interval', dest='sleep', default=1.0, metavar='S', type='float',
+    parser.add_option('-s', '--sleep-interval', dest='sleep', default=2.0, metavar='S', type='float',
                       help='with  -f,  sleep  for  approximately  S  seconds between file iterations')
 
     parser.add_option('', '--test', dest='test', default=False, action='store_true',