tweak graph style

This commit is contained in:
2020-07-20 22:30:24 -04:00
parent 1bb466762f
commit effc30c991
2 changed files with 10 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ def flame_graph_get(key: str):
return Response(content=data, media_type="image/svg+xml")
@app.post("/flame_graph")
def flame_graph(file: bytes = File(...)):
def flame_graph(file: bytes = File(...), width: int = 1200):
key = str(uuid.uuid4())
temp = "/dev/shm/fg_%s.bin" % key
with open(temp, "wb") as f:
@@ -51,7 +51,8 @@ def flame_graph(file: bytes = File(...)):
)
p3 = Popen(
["perl", "flamegraph.pl"],
["perl", "flamegraph.pl", "--bgcolors", "#FFFFFF",
"--fontsize", "10", "--fonttype", "monospace", "--width", str(width), "--title", " "],
cwd="./FlameGraph",
stdin=PIPE, stdout=PIPE, stderr=PIPE
)