mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
if --profile is enabled, dump results every ten minutes, as well as at shutdown
This commit is contained in:
parent
af6e5ea112
commit
399853dea0
2
setup.py
2
setup.py
@ -52,7 +52,7 @@ except:
|
||||
|
||||
setuptools.setup(
|
||||
name='warcprox',
|
||||
version='2.3.1b4.dev127',
|
||||
version='2.3.1b4.dev128',
|
||||
description='WARC writing MITM HTTP/S proxy',
|
||||
url='https://github.com/internetarchive/warcprox',
|
||||
author='Noah Levitt',
|
||||
|
@ -227,6 +227,7 @@ class WarcproxController(object):
|
||||
self.start()
|
||||
|
||||
last_mem_dbg = datetime.datetime.utcfromtimestamp(0)
|
||||
last_profile_dump = datetime.datetime.utcnow()
|
||||
|
||||
try:
|
||||
utc = datetime.timezone.utc
|
||||
@ -253,6 +254,12 @@ class WarcproxController(object):
|
||||
# self.debug_mem()
|
||||
# last_mem_dbg = datetime.datetime.utcnow()
|
||||
|
||||
if (self.options.profile and
|
||||
(datetime.datetime.utcnow() - last_profile_dump
|
||||
).total_seconds() > 60*10):
|
||||
self._dump_profiling()
|
||||
last_profile_dump = datetime.datetime.utcnow()
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
if self.options.profile:
|
||||
|
Loading…
x
Reference in New Issue
Block a user