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
|
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
|
2017-06-07 03:57:21 -04:00
|
|
|
else
|
|
|
|
require 'peek-pg'
|
2017-06-07 10:53:13 -04:00
|
|
|
PEEK_DB_CLIENT = ::PG::Connection
|
|
|
|
PEEK_DB_VIEW = Peek::Views::PG
|
2017-06-07 03:57:21 -04:00
|
|
|
end
|
2017-06-07 13:55:07 -04:00
|
|
|
Peek.into PEEK_DB_VIEW
|
2017-05-17 07:20:55 -04:00
|
|
|
Peek.into Peek::Views::Redis
|
|
|
|
Peek.into Peek::Views::Sidekiq
|
|
|
|
Peek.into Peek::Views::Rblineprof
|
|
|
|
Peek.into Peek::Views::GC
|
2017-06-01 10:10:17 -04:00
|
|
|
|
2017-06-07 17:51:13 -04:00
|
|
|
# rubocop:disable Style/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
|