summaryrefslogtreecommitdiff
path: root/doc/development/profiling.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/development/profiling.md')
-rw-r--r--doc/development/profiling.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/development/profiling.md b/doc/development/profiling.md
index 0b0c6dfc8cf..f41d635de43 100644
--- a/doc/development/profiling.md
+++ b/doc/development/profiling.md
@@ -72,6 +72,15 @@ Gitlab::Profiler.print_by_total_time(result, max_percent: 60, min_percent: 2)
# 0.02 0.865 0.000 0.000 0.864 638 *Enumerable#inject
```
+To print the profile in HTML format, use the following example:
+
+```ruby
+result = Gitlab::Profiler.profile('/my-user')
+
+printer = RubyProf::CallStackPrinter.new(result)
+printer.print(File.open('/tmp/profile.html', 'w'))
+```
+
[GitLab-Profiler](https://gitlab.com/gitlab-com/gitlab-profiler) is a project
that builds on this to add some additional niceties, such as allowing
configuration with a single Yaml file for multiple URLs, and uploading of the
@@ -82,7 +91,6 @@ Redash to Looker](https://gitlab.com/gitlab-com/Product/issues/5#note_121194467)
We are [currently investigating how to make this data
public](https://gitlab.com/meltano/looker/issues/294).
-
## Sherlock
Sherlock is a custom profiling tool built into GitLab. Sherlock is _only_