Skip to content
Snippets Groups Projects
Commit a1a961ac8c5e authored by Georges Racinet's avatar Georges Racinet
Browse files

WIP clearer logs

parent 06c4806e2ebd
No related tags found
1 merge request!67Topic/default/repo cache
Pipeline #97453 canceled
......@@ -27,6 +27,7 @@
hg,
util,
)
from mercurial.localrepo import localrepository
from mercurial.repoview import _filteredrepotypes
logger = logging.getLogger(__file__)
......@@ -73,7 +74,7 @@
return
target_len = max(1, int(initial_len * self.drop_ratio))
logger.warning("Current RSS %d (%d MB) is above threshold %dMB. "
logger.warning("Current RSS %d (%d MiB) is above threshold %d "
"Dropping %d repository instances from cache",
current_rss, current_rss >> 20, self.rss_threshold,
initial_len - target_len)
......@@ -97,4 +98,7 @@
n.markempty()
n = n.prev
gc.collect()
count = sum(1 for o in gc.get_objects()
if isinstance(o, localrepository))
logger.info("Right after dropping repository instances from cache, "
......@@ -100,6 +104,9 @@
logger.info("Right after dropping repository instances from cache, "
"and calling GC, RSS is at %dMB",
self.process.memory_info().rss >> 20)
"and garbage collection, RSS is at %dMB, target_len=%d, "
"new cache length=%d, "
"total count of live repository object in process is %d",
self.process.memory_info().rss >> 20,
target_len, len(self._cache), count)
def acknowledge_mutation(repo):
......@@ -169,5 +176,5 @@
# any mutation since the system was introduced, hence a cached instance
# that reflects that is not stale.
if read_mutation_id(repo) == getattr(repo, MUTATION_ID_ATTR):
logger.debug("Repository %r: returning from cache", path)
logger.info("Repository %r: returning from cache", path)
return repo
......@@ -173,4 +180,7 @@
return repo
else:
logger.info("Repository %r is stale. Will make new instance",
path)
# repo not found in cache or was stale
logger.info("Repository %r: making new instance", path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment