mirror of
https://github.com/facebook/sapling.git
synced 2024-12-29 08:02:24 +03:00
perftrace: limit the size of the perftrace in blackbox
Summary: There are cases where Mercurial makes many serial requests to the server. This diff limits the number of lines that a perftrace can send to blackbox or print on stderr. Reviewed By: xavierd Differential Revision: D17078475 fbshipit-source-id: 8c8313ae0b602160e1018590dd6b87dfffd27662
This commit is contained in:
parent
33f371d27c
commit
f8ed4ca01d
@ -491,8 +491,20 @@ def dispatch(req):
|
||||
"pid": os.getpid(),
|
||||
"time": time.time(),
|
||||
}
|
||||
splitoutput = output.split("\n")
|
||||
if len(splitoutput) > 200:
|
||||
readableoutput = "\n".join(
|
||||
splitoutput[:200]
|
||||
+ ["Perftrace trunkated at 200 lines, see {}".format(key)]
|
||||
)
|
||||
else:
|
||||
readableoutput = output
|
||||
req.ui.log(
|
||||
"perftrace", "Trace:\n%s\n", output, key=key, payload=output
|
||||
"perftrace",
|
||||
"Trace:\n%s\n",
|
||||
readableoutput,
|
||||
key=key,
|
||||
payload=output,
|
||||
)
|
||||
req.ui.log("perftracekey", "Trace key:%s\n", key, perftracekey=key)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user