diff options
author | Drew Blessing <drew@blessing.io> | 2019-02-11 17:51:56 +0000 |
---|---|---|
committer | Marcia Ramos <marcia@gitlab.com> | 2019-02-11 17:51:56 +0000 |
commit | bac1f72c5750fa54d712411a6a3ade71dd67b673 (patch) | |
tree | 711c7f2e1b7fec9fbbfeed98ba4d02df464b0b25 /doc/development/profiling.md | |
parent | 6328af4e126588ccd383713287a74981400ba650 (diff) | |
download | gitlab-ce-bac1f72c5750fa54d712411a6a3ade71dd67b673.tar.gz |
Add HTML output example to profiling
Diffstat (limited to 'doc/development/profiling.md')
-rw-r--r-- | doc/development/profiling.md | 10 |
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 |