2017-07-10 23:35:47 -04:00
|
|
|
Rails.application.config.peek.adapter = :redis, { client: ::Redis.new(Gitlab::Redis::Cache.params) }
|
2017-05-17 07:20:55 -04:00
|
|
|
|
|
|
|
Peek.into Peek::Views::Host
|
|
|
|
Peek.into Peek::Views::PerformanceBar
|
2018-01-11 11:34:01 -05:00
|
|
|
|
2017-06-07 03:57:21 -04:00
|
|
|
if Gitlab::Database.mysql?
|
2017-06-07 13:55:07 -04:00
|
|
|
require 'peek-mysql2'
|
2017-06-07 10:53:13 -04:00
|
|
|
PEEK_DB_CLIENT = ::Mysql2::Client
|
|
|
|
PEEK_DB_VIEW = Peek::Views::Mysql2
|
2018-01-30 13:55:51 -05:00
|
|
|
elsif Gitlab::Database.postgresql?
|
2017-06-07 03:57:21 -04:00
|
|
|
require 'peek-pg'
|
2017-06-07 10:53:13 -04:00
|
|
|
PEEK_DB_CLIENT = ::PG::Connection
|
|
|
|
PEEK_DB_VIEW = Peek::Views::PG
|
2018-01-30 13:55:51 -05:00
|
|
|
else
|
|
|
|
raise "Unsupported database adapter for peek!"
|
2017-06-07 03:57:21 -04:00
|
|
|
end
|
2018-01-11 11:34:01 -05:00
|
|
|
|
2017-06-07 13:55:07 -04:00
|
|
|
Peek.into PEEK_DB_VIEW
|
2018-03-08 04:58:24 -05:00
|
|
|
Peek.into Peek::Views::Gitaly
|
|
|
|
Peek.into Peek::Views::Rblineprof
|
2017-05-17 07:20:55 -04:00
|
|
|
Peek.into Peek::Views::Redis
|
|
|
|
Peek.into Peek::Views::Sidekiq
|
|
|
|
Peek.into Peek::Views::GC
|
2017-06-01 10:10:17 -04:00
|
|
|
|
2017-09-19 11:25:42 -04:00
|
|
|
# rubocop:disable Naming/ClassAndModuleCamelCase
|
2017-06-07 10:53:13 -04:00
|
|
|
class PEEK_DB_CLIENT
|
|
|
|
class << self
|
|
|
|
attr_accessor :query_details
|
2017-06-01 10:10:17 -04:00
|
|
|
end
|
2017-06-07 10:53:13 -04:00
|
|
|
self.query_details = Concurrent::Array.new
|
2017-06-01 10:10:17 -04:00
|
|
|
end
|
2017-06-07 10:53:13 -04:00
|
|
|
|
|
|
|
PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker
|