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',
|
'aggregate performance profile of %s proxy threads:\n%s',
|
||||||
len(files), buf.getvalue())
|
len(files), buf.getvalue())
|
||||||
|
|
||||||
|
|
||||||
# warc writer threads
|
# warc writer threads
|
||||||
files = []
|
files = []
|
||||||
for wwt in self.warc_writer_threads:
|
for wwt in self.warc_writer_threads:
|
||||||
file = os.path.join(tmpdir, '%s.dat' % th_id)
|
file = os.path.join(tmpdir, '%s.dat' % wwt.ident)
|
||||||
profiler.dump_stats(file)
|
wwt.profiler.dump_stats(file)
|
||||||
files.append(file)
|
files.append(file)
|
||||||
|
|
||||||
buf = io.StringIO()
|
buf = io.StringIO()
|
||||||
|
@ -56,12 +56,10 @@ class WarcWriterThread(threading.Thread):
|
|||||||
self.idle = None
|
self.idle = None
|
||||||
self.method_filter = set(method.upper() for method in self.options.method_filter or [])
|
self.method_filter = set(method.upper() for method in self.options.method_filter or [])
|
||||||
|
|
||||||
|
def run(self):
|
||||||
if self.options.profile:
|
if self.options.profile:
|
||||||
import cProfile
|
import cProfile
|
||||||
self.profiler = cProfile.Profile()
|
self.profiler = cProfile.Profile()
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.options.profile:
|
|
||||||
self.profiler.enable()
|
self.profiler.enable()
|
||||||
self._run()
|
self._run()
|
||||||
self.profiler.disable()
|
self.profiler.disable()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user