diff options
| author | Robert Speicher <robert@gitlab.com> | 2017-06-12 19:23:49 +0000 |
|---|---|---|
| committer | Robert Speicher <robert@gitlab.com> | 2017-06-12 19:23:49 +0000 |
| commit | 5a66e6d968fb9b1bd1159b9156a88bd06208e363 (patch) | |
| tree | 99bd4cdca441db24dd538c6811f9d76c12d2de58 /config | |
| parent | 8d7951d879d13894dcc1fd5d845c8d844bee321a (diff) | |
| parent | be0a949a004a34015977bdbcfe24e3173cd3aba9 (diff) | |
| download | gitlab-ce-5a66e6d968fb9b1bd1159b9156a88bd06208e363.tar.gz | |
Merge branch '29010-perf-bar' into 'master'
Add an optional performance bar to view performance metrics for the current page
Closes #29010
See merge request !11439
Diffstat (limited to 'config')
| -rw-r--r-- | config/application.rb | 1 | ||||
| -rw-r--r-- | config/initializers/peek.rb | 32 | ||||
| -rw-r--r-- | config/routes.rb | 1 | ||||
| -rw-r--r-- | config/webpack.config.js | 1 |
4 files changed, 35 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb index b0533759252..8bbecf3ed0f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -105,6 +105,7 @@ module Gitlab config.assets.precompile << "katex.css" config.assets.precompile << "katex.js" config.assets.precompile << "xterm/xterm.css" + config.assets.precompile << "peek.css" config.assets.precompile << "lib/ace.js" config.assets.precompile << "vendor/assets/fonts/*" config.assets.precompile << "test.css" diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb new file mode 100644 index 00000000000..65432caac2a --- /dev/null +++ b/config/initializers/peek.rb @@ -0,0 +1,32 @@ +Rails.application.config.peek.adapter = :redis, { client: ::Redis.new(Gitlab::Redis.params) } + +Peek.into Peek::Views::Host +Peek.into Peek::Views::PerformanceBar +if Gitlab::Database.mysql? + require 'peek-mysql2' + PEEK_DB_CLIENT = ::Mysql2::Client + PEEK_DB_VIEW = Peek::Views::Mysql2 +else + require 'peek-pg' + PEEK_DB_CLIENT = ::PG::Connection + PEEK_DB_VIEW = Peek::Views::PG +end +Peek.into PEEK_DB_VIEW +Peek.into Peek::Views::Redis +Peek.into Peek::Views::Sidekiq +Peek.into Peek::Views::Rblineprof +Peek.into Peek::Views::GC + +# rubocop:disable Style/ClassAndModuleCamelCase +class PEEK_DB_CLIENT + class << self + attr_accessor :query_details + end + self.query_details = Concurrent::Array.new +end + +PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker + +class Peek::Views::PerformanceBar::ProcessUtilization + prepend ::Gitlab::PerformanceBar::PeekPerformanceBarWithRackBody +end diff --git a/config/routes.rb b/config/routes.rb index d909be38b42..4fd6cb5d439 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -42,6 +42,7 @@ Rails.application.routes.draw do get 'liveness' => 'health#liveness' get 'readiness' => 'health#readiness' resources :metrics, only: [:index] + mount Peek::Railtie => '/peek' end # Koding route diff --git a/config/webpack.config.js b/config/webpack.config.js index c5060669da1..120f9d3193d 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -78,6 +78,7 @@ var config = { raven: './raven/index.js', vue_merge_request_widget: './vue_merge_request_widget/index.js', test: './test.js', + peek: './peek.js', }, output: { |
