scuba: round bytes to the nearest useful value

Summary: This will reduce the amount of space they take in scuba.

Reviewed By: xavierd

Differential Revision: D21483472

fbshipit-source-id: 9de49dedef480932f8583dd17fe6625d222a3285
This commit is contained in:
Durham Goode 2020-05-11 21:28:59 -07:00 committed by Facebook GitHub Bot
parent 95f0b94031
commit 20c3f8b34d

View File

@ -27,6 +27,8 @@ configitem = registrar.configitem(configtable)
configitem("sampling", "filepath", default="")
configitem("sampling", "debug", default=False)
onehundredmb = 100 * 1024 * 1024
def getrelativecwd(repo):
"""Returns the current directory relative to the working copy root, or
@ -64,7 +66,8 @@ def telemetry(reporef):
except Exception:
pass
maxrss = util.getmaxrss()
# Round to the nearest 100MB megabyte to reduce our storage size
maxrss = int(util.getmaxrss() / onehundredmb) * onehundredmb
# Log maxrss from within the hg process. The wrapper logs its own
# value (which is incorrect if chg is used) so the column is