mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
fix mistakes in warc write thread profile aggregation
This commit is contained in:
parent
5c2c21de07
commit
fdfc84cea0
@ -283,12 +283,11 @@ class WarcproxController(object):
|
||||
'aggregate performance profile of %s proxy threads:\n%s',
|
||||
len(files), buf.getvalue())
|
||||
|
||||
|
||||
# warc writer threads
|
||||
files = []
|
||||
for wwt in self.warc_writer_threads:
|
||||
file = os.path.join(tmpdir, '%s.dat' % th_id)
|
||||
profiler.dump_stats(file)
|
||||
file = os.path.join(tmpdir, '%s.dat' % wwt.ident)
|
||||
wwt.profiler.dump_stats(file)
|
||||
files.append(file)
|
||||
|
||||
buf = io.StringIO()
|
||||
|
@ -56,12 +56,10 @@ class WarcWriterThread(threading.Thread):
|
||||
self.idle = None
|
||||
self.method_filter = set(method.upper() for method in self.options.method_filter or [])
|
||||
|
||||
def run(self):
|
||||
if self.options.profile:
|
||||
import cProfile
|
||||
self.profiler = cProfile.Profile()
|
||||
|
||||
def run(self):
|
||||
if self.options.profile:
|
||||
self.profiler.enable()
|
||||
self._run()
|
||||
self.profiler.disable()
|
||||
|
Loading…
x
Reference in New Issue
Block a user