GitLab Profiler doesn't work with relative path
While profiling on GitLab.com:
With relative path
irb(main):009:0> result = Gitlab::Profiler.profile('gitlab-org/gitlab-ce/merge_requests/12463.json', logger: Logger.new(STDOUT), user: User.find_by(username: 'oswaldo'))
Host 10.66.1.103 came back online
Started GET "/api/v4/users" for 127.0.0.1 at 2018-02-19 14:38:03 +0000
Processing by Gitlab::RequestForgeryProtection::Controller#index as HTML
Completed 200 OK in 0ms (ActiveRecord: 0.0ms | Elasticsearch: 0.0ms)
=> #<RubyProf::Profile:0x00007fb597c93c28>
irb(main):010:0> result
=> #<RubyProf::Profile:0x00007fb597c93c28>
With full path:
irb(main):001:0> Gitlab::Profiler.profile('https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12463.json', logger: Logger.new(STDOUT), user: User.find_by(username: 'oswaldo'))
Started GET "/api/v4/users" for 127.0.0.1 at 2018-02-19 15:26:50 +0000
Processing by Gitlab::RequestForgeryProtection::Controller#index as HTML
Completed 200 OK in 1ms (ActiveRecord: 0.0ms | Elasticsearch: 0.0ms)
Started GET "/gitlab-org/gitlab-ce/merge_requests/12463.json" for 127.0.0.1 at 2018-02-19 15:26:55 +0000
D, [2018-02-19T15:26:55.165740 #124652] DEBUG -- : Group Load (4.3ms) SELECT "namespaces".* FROM "namespaces" INNER JOIN "routes" ON "routes"."source_id" = "namespaces"."id" AND "routes"."source_type" = 'Namespace' WHERE "namespaces"."type" IN ('Group') AND ((LOWER(routes.path) = LOWER('gitlab-org/gitlab-ce/merge_requests/12463'))) ORDER BY (CASE WHEN routes.path = 'gitlab-org/gitlab-ce/merge_requests/12463' THEN 0 ELSE 1 END) LIMIT 1 [["source_type", "Namespace"]]
D, [2018-02-19T15:26:55.168446 #124652] DEBUG -- : ↳ app/models/concerns/routable.rb:46:in `find_by_full_path'
D, [2018-02-19T15:26:55.168666 #124652] DEBUG -- : ↳ lib/constraints/group_url_constrainer.rb:7:in `matches?'
D, [2018-02-19T15:26:55.211538 #124652] DEBUG -- : Group Load (3.0ms) SELECT "namespaces".* FROM "namespaces" INNER JOIN "redirect_routes" ON "redirect_routes"."source_id" = "namespaces"."id" AND "redirect_routes"."source_type" = 'Namespace' WHERE "namespaces"."type" IN ('Group') AND (LOWER(redirect_routes.path) = LOWER('gitlab-org/gitlab-ce/merge_requests/12463')) LIMIT 1 [["source_type", "Namespace"]]
...
Edited by Oswaldo Ferreira