summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcia Ramos <marcia@gitlab.com>2019-02-11 17:51:56 +0000
committerMarcia Ramos <marcia@gitlab.com>2019-02-11 17:51:56 +0000
commit15d63ff1023c6a683a1f77b54829980be63dfabb (patch)
tree711c7f2e1b7fec9fbbfeed98ba4d02df464b0b25
parent6328af4e126588ccd383713287a74981400ba650 (diff)
parentbac1f72c5750fa54d712411a6a3ade71dd67b673 (diff)
downloadgitlab-ce-15d63ff1023c6a683a1f77b54829980be63dfabb.tar.gz
Merge branch 'docs-profile-html-output-example' into 'master'
Add HTML output example to profiling See merge request gitlab-org/gitlab-ce!25103
-rw-r--r--doc/development/profiling.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/development/profiling.md b/doc/development/profiling.md
index 0b0c6dfc8cf..b7d9f640a3f 100644
--- a/doc/development/profiling.md
+++ b/doc/development/profiling.md
@@ -72,6 +72,16 @@ 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