logginghelper: log obsstore size

Summary: That's an interesting piece of information that we'd like to know.

Test Plan: Enable patched logginghelper.py extension and check that new field is logged

Reviewers: #mercurial, simonfar

Subscribers: mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D4936862

Tasks: 17453793
This commit is contained in:
Stanislau Hlebik 2017-04-25 01:09:28 -07:00
parent d610259241
commit 8595e6160c

View File

@ -38,6 +38,15 @@ def _localrepoinit(orig, self, baseui, path=None, create=False):
if value is not None:
kwargs[name] = value
obsstore_size = 0
try:
obsstore_size = self.svfs.stat('obsstore').st_size
except Exception:
# just ignore exception, it's better than failing the whole command
pass
kwargs['obsstore_size'] = obsstore_size
self.ui.log("logginghelper",
"", # ui.log requires a format string as args[0].
**kwargs)