Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

document profiling bodied api requests

ulferts2f1945729121
diff --git a/docs/development/profiling/README.md b/docs/development/profiling/README.md
index ecbbc079abe..6a80d25f88a 100644
--- a/docs/development/profiling/README.md
+++ b/docs/development/profiling/README.md
@@ -60,3 +60,21 @@ Having a flamegraph displayed is triggered by issuing the request with `pp=flame
will show the flamegraph for that api request.
The options available can be displayed by adding `pp=help` to a query.
+
+### API patch/post requests
+
+For bodied requests (e.g. patch/post) which typically are triggered not from a browser when profiling, a flamegraph can still be created, e.g.:
+
+`PATCH http://localhost:3000/api/v3/work_packages/1547?pp=async-flamegraph`
+
+will result in a flamegraph being created. Instead of appending `pp=flamegraph`, the appended parameter needs to be `pp=async-flamegraph`.
+
+But that flamegraph will not show up directly in the tools typically used.
+
+The flamegraph needs to be accessed by calling an arbitrary page of the application via the browser after having issued the bodied request (e.g. `http://localhost:3000`). In the lower right corner, sometimes after some waiting, the profiling tools will show a small menu from which the generated flamegraph can be accessed.
+
+![Flamegraph retrieval](flamegraph_retrieval.png)
+
+In case this fails, the flamegraphs are stored in `tmp/miniprofiler` in a file called `mp_timers_[some hash]`. Knowing which file belongs to the previously created flamegraph, the file can be opened by requesting:
+
+`http://localhost:3000/mini-profiler-resources/flamegraph?id=[some hash]`
diff --git a/docs/development/profiling/flamegraph_retrieval.png b/docs/development/profiling/flamegraph_retrieval.png
new file mode 100644
index 00000000000..bd7b0f79c0b
Binary files /dev/null and b/docs/development/profiling/flamegraph_retrieval.png differ