diff --git a/api/app.py b/api/app.py index d968ab5..de2807b 100755 --- a/api/app.py +++ b/api/app.py @@ -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 ) diff --git a/toolbox-web/src/components/FlameGraph.vue b/toolbox-web/src/components/FlameGraph.vue index 3195021..5cfa94b 100644 --- a/toolbox-web/src/components/FlameGraph.vue +++ b/toolbox-web/src/components/FlameGraph.vue @@ -1,8 +1,10 @@