mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
include tid in thread name for more threads (linux only) for correlation with top -H
This commit is contained in:
parent
a9fc550453
commit
fcaaa7b09b
@ -15,11 +15,14 @@ except ImportError:
|
||||
import socket
|
||||
import logging
|
||||
import ssl
|
||||
import warcprox
|
||||
import threading
|
||||
|
||||
class MitmProxyHandler(http_server.BaseHTTPRequestHandler):
|
||||
logger = logging.getLogger("warcprox.mitmproxy.MitmProxyHandler")
|
||||
|
||||
def __init__(self, request, client_address, server):
|
||||
threading.current_thread.name = 'MitmProxyHandler-thread(tid={})'.format(warcprox.gettid())
|
||||
self.is_connect = False
|
||||
self._headers_buffer = []
|
||||
http_server.BaseHTTPRequestHandler.__init__(self, request, client_address, server)
|
||||
|
@ -41,7 +41,7 @@ class WarcWriterThread(threading.Thread):
|
||||
def _run(self):
|
||||
while not self.stop.is_set():
|
||||
try:
|
||||
self.setName('WarcWriterThread(tid={})'.format(warcprox.gettid()))
|
||||
self.name = 'WarcWriterThread(tid={})'.format(warcprox.gettid())
|
||||
while True:
|
||||
try:
|
||||
recorded_url = self.recorded_url_q.get(block=True, timeout=0.5)
|
||||
|
Loading…
x
Reference in New Issue
Block a user