2017-05-17 11:20:55 +00:00
|
|
|
Rails.application.config.peek.adapter = :redis, { client: ::Redis.new(Gitlab::Redis.params) }
|
|
|
|
|
|
|
|
Peek.into Peek::Views::Host
|
|
|
|
Peek.into Peek::Views::PerformanceBar
|
2017-06-07 07:57:21 +00:00
|
|
|
if Gitlab::Database.mysql?
|
2017-06-07 17:55:07 +00:00
|
|
|
require 'peek-mysql2'
|
2017-06-07 14:53:13 +00:00
|
|
|
PEEK_DB_CLIENT = ::Mysql2::Client
|
|
|
|
PEEK_DB_VIEW = Peek::Views::Mysql2
|
2017-06-07 07:57:21 +00:00
|
|
|
else
|
|
|
|
require 'peek-pg'
|
2017-06-07 14:53:13 +00:00
|
|
|
PEEK_DB_CLIENT = ::PG::Connection
|
|
|
|
PEEK_DB_VIEW = Peek::Views::PG
|
2017-06-07 07:57:21 +00:00
|
|
|
end
|
2017-06-07 17:55:07 +00:00
|
|
|
Peek.into PEEK_DB_VIEW
|
2017-05-17 11:20:55 +00:00
|
|
|
Peek.into Peek::Views::Redis
|
|
|
|
Peek.into Peek::Views::Sidekiq
|
|
|
|
Peek.into Peek::Views::Rblineprof
|
|
|
|
Peek.into Peek::Views::GC
|
2017-06-01 14:10:17 +00:00
|
|
|
|
2017-06-07 14:53:13 +00:00
|
|
|
class PEEK_DB_CLIENT
|
|
|
|
class << self
|
|
|
|
attr_accessor :query_details
|
2017-06-01 14:10:17 +00:00
|
|
|
end
|
2017-06-07 14:53:13 +00:00
|
|
|
self.query_details = Concurrent::Array.new
|
2017-06-01 14:10:17 +00:00
|
|
|
end
|
2017-06-07 14:53:13 +00:00
|
|
|
|
2017-06-07 17:55:07 +00:00
|
|
|
# rubocop:disable Style/ClassAndModuleCamelCase
|
2017-06-07 14:53:13 +00:00
|
|
|
PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker
|