summaryrefslogtreecommitdiff
path: root/doc/development
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-02-16 17:38:45 +1100
committerDylan Griffith <dyl.griffith@gmail.com>2018-02-16 19:47:44 +1100
commitbda4f0811e3d7f3530d1d6c338e2de6ada5bf1f2 (patch)
tree935b8b18311275a85dc2b069e90fb0a37b42a75d /doc/development
parent1192526b89f2a6a24bbe6a0abe12443450fef95d (diff)
downloadgitlab-ce-update-profiler-docs-explaining-how-to-provide-user.tar.gz
Improve error handling for Gitlab::Profiler and improve doc about providing a userupdate-profiler-docs-explaining-how-to-provide-user
Diffstat (limited to 'doc/development')
-rw-r--r--doc/development/profiling.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/development/profiling.md b/doc/development/profiling.md
index 97c997e0568..11878b4009b 100644
--- a/doc/development/profiling.md
+++ b/doc/development/profiling.md
@@ -27,6 +27,17 @@ Gitlab::Profiler.profile('/my-user')
# Returns a RubyProf::Profile where 100 seconds is spent in UsersController#show
```
+For routes that require authorization you will need to provide a user to
+`Gitlab::Profiler`. You can do this like so:
+
+```ruby
+Gitlab::Profiler.profile('/gitlab-org/gitlab-test', user: User.first)
+```
+
+The user you provide will need to have a [personal access
+token](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html) in
+the GitLab instance.
+
Passing a `logger:` keyword argument to `Gitlab::Profiler.profile` will send
ActiveRecord and ActionController log output to that logger. Further options are
documented with the method source.