Commits

Peter Nixon  committed 5cfe222

It's more usefull it we print the full URL instead of just the TLD here

  • Participants
  • Parent commits 1a4cad3

Comments (0)

Files changed (3)

                 if (log.run_regex(line, process_hostnames=True)):
                     if options.code:
                         if (log.status == options.code):
-                            print log.timestamp, log.msisdn, log.client, log.server, log.method, log.status, log.domainname
+                            print log.timestamp, log.msisdn, log.client, log.server, log.method, log.status, log.url
                     else:
-                        print log.timestamp, log.msisdn, log.client, log.server, log.method, log.status, log.domainname
+                        print log.timestamp, log.msisdn, log.client, log.server, log.method, log.status, log.url
 
         except KeyboardInterrupt:
             # Escape silently
                     status_counter[log.status] +=1
                     status_dict[log.domainname][log.status] +=1
                 if int(time.time()) > nextrefresh:
+                    bypass_percent = float(bypassed_requests) / float(total_requests) * 100
                     proxy_fail_percent = float(status_counter[504]) / float(total_requests) * 100
                     rootwin.border(0)
-                    rootwin.addstr(1, 1, "#  Hits      Site                      Top Status")
-                    rootwin.addstr(height - 2, 1, "Sites: %d  Requests: %d  Bypassed: %d  Proxy Fails: %d (%f%%)" % (len(host_counter), total_requests, bypassed_requests, status_counter[504], proxy_fail_percent))
+                    rootwin.addstr(1, 1, "#  Hits      Site                          Proxy Timeout")
+                    rootwin.addstr(height - 2, 1, "Sites: %d  Requests: %d  Bypassed: %d (%f%%) Proxy Fails: %d (%f%%)" % (len(host_counter), total_requests, bypassed_requests, bypass_percent, status_counter[504], proxy_fail_percent))
                     rootwin.hline(2, 1, curses.ACS_HLINE, width)
                     n = 1
                     y = 3
                         rootwin.addstr(y, 1, str(n))
                         rootwin.addstr(y, 4, str(num))
                         rootwin.addstr(y, 14, str(key))
-                        for (key2, num2) in status_dict[key].most_common(1):
-                            rootwin.addstr(y, 40, str(key2))
+                        #for (key2, num2) in status_dict[key].most_common(1):
+                        #    rootwin.addstr(y, 40, str(key2))
+                        host_proxy_fail_percent = float(status_dict[key][504]) / float(total_requests) * 100
+                        rootwin.addstr(y, 44, "%f%% (%d)" % (host_proxy_fail_percent, status_dict[key][504]))
                         n += 1
                         y += 1
                     nextrefresh = int(time.time()) + refreshinterval

File bmutils/bmutils.py

 
 DEBUG = False
 
-TLD_CACHE = os.path.join(os.path.dirname(__file__), 'effective_tld_names.dat')
+TLD_DAT = os.path.join(os.path.dirname(__file__), 'effective_tld_names.dat')
 
 logging.basicConfig()
 _pattern = re.compile(