mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
run warc writer thread with profiling enabled, dump results when shutting down
This commit is contained in:
parent
e0fe06c891
commit
6476262f11
@ -16,6 +16,7 @@ from datetime import datetime
|
||||
import hanzo.httptools
|
||||
from hanzo import warctools
|
||||
import warcprox
|
||||
import cProfile
|
||||
|
||||
class WarcWriterThread(threading.Thread):
|
||||
logger = logging.getLogger("warcprox.warcproxwriter.WarcWriterThread")
|
||||
@ -35,6 +36,9 @@ class WarcWriterThread(threading.Thread):
|
||||
self.idle = None
|
||||
|
||||
def run(self):
|
||||
cProfile.runctx('self._run()', globals(), locals(), sort='cumulative')
|
||||
|
||||
def _run(self):
|
||||
try:
|
||||
self.setName('WarcWriterThread(tid={})'.format(warcprox.gettid()))
|
||||
while True:
|
||||
|
Loading…
x
Reference in New Issue
Block a user