BigW Consortium Gitlab

peek.rb 802 Bytes
Newer Older
1
Rails.application.config.peek.adapter = :redis, { client: ::Redis.new(Gitlab::Redis::Cache.params) }
2 3 4

Peek.into Peek::Views::Host
Peek.into Peek::Views::PerformanceBar
5
if Gitlab::Database.mysql?
6
  require 'peek-mysql2'
7 8
  PEEK_DB_CLIENT = ::Mysql2::Client
  PEEK_DB_VIEW = Peek::Views::Mysql2
9 10
else
  require 'peek-pg'
11 12
  PEEK_DB_CLIENT = ::PG::Connection
  PEEK_DB_VIEW = Peek::Views::PG
13
end
14
Peek.into PEEK_DB_VIEW
15 16 17 18
Peek.into Peek::Views::Redis
Peek.into Peek::Views::Sidekiq
Peek.into Peek::Views::Rblineprof
Peek.into Peek::Views::GC
19
Peek.into Peek::Views::Gitaly
20

21
# rubocop:disable Style/ClassAndModuleCamelCase
22 23 24
class PEEK_DB_CLIENT
  class << self
    attr_accessor :query_details
25
  end
26
  self.query_details = Concurrent::Array.new
27
end
28 29

PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker