Add bit more diag output.

This commit is contained in:
Jim Miller 2021-02-03 13:17:04 -06:00
parent d6684663bb
commit 4d1326c1bb
3 changed files with 15 additions and 13 deletions

View file

@ -21,18 +21,18 @@ logger = logging.getLogger(__name__)
# profile.print_stats()
# return profiled_func
# import time
# def do_cprofile(func):
# def profiled_func(*args, **kwargs):
# t=0
# try:
# t = time.time()
# result = func(*args, **kwargs)
# t = time.time() - t
# return result
# finally:
# logger.debug("do_cprofile time:%s"%t)
# return profiled_func
import time
def do_cprofile(func):
def profiled_func(*args, **kwargs):
t=0
try:
t = time.time()
result = func(*args, **kwargs)
t = time.time() - t
return result
finally:
logger.debug("do_cprofile time:%s"%t)
return profiled_func
class BrowserCache(object):
@ -54,7 +54,7 @@ class BrowserCache(object):
if autoload:
self.do_map_cache_keys()
# @do_cprofile
@do_cprofile
def do_map_cache_keys(self,autoload=True):
logger.debug("do_map_cache_keys()")
self.browser_cache.map_cache_keys()

View file

@ -37,6 +37,7 @@ class BlockfileCache(BaseBrowserCache):
# Checking type
if self.cacheBlock.type != CacheBlock.INDEX:
raise Exception("Invalid Index File")
logger.debug("Using BlockfileCache")
@staticmethod
def is_cache_dir(cache_dir):

View file

@ -28,6 +28,7 @@ class SimpleCache(BaseBrowserCache):
def __init__(self, cache_dir):
"""Constructor for SimpleCache"""
BaseBrowserCache.__init__(self,cache_dir)
logger.debug("Using BlockfileCache")
@staticmethod
def is_cache_dir(cache_dir):