Welcome to mirror list, hosted at ThFree Co, Russian Federation.

peek.rb « initializers « config - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 89fd17a4ab871c4e3e3e85872154278c77f9dd4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

require 'peek/adapters/redis'

Peek::Adapters::Redis.prepend ::Gitlab::PerformanceBar::RedisAdapterWhenPeekEnabled
Peek.singleton_class.prepend ::Gitlab::PerformanceBar::WithTopLevelWarnings

Rails.application.config.peek.adapter = :redis, {
  client: Gitlab::Redis::Cache.multistore_redis, # to be reverted after MultiStore in Cache is removed
  expires_in: 5.minutes
}

Peek.into Peek::Views::Host
Peek.into Peek::Views::ActiveRecord
Peek.into Peek::Views::Gitaly
Peek.into Peek::Views::RedisDetailed
Peek.into Peek::Views::Elasticsearch
Peek.into Peek::Views::Zoekt
Peek.into Peek::Views::Rugged
Peek.into Peek::Views::ExternalHttp
Peek.into Peek::Views::BulletDetailed if defined?(Bullet)
Peek.into Peek::Views::Memory

Peek.into Peek::Views::Tracing if Labkit::Tracing.tracing_url_enabled?

# Trigger view creation here, since views might be subscribing to Rails notifications
# via setup_subscribers, which is called in the initializer.
# See https://github.com/peek/peek/blob/master/lib/peek/views/view.rb
Peek.views

ActiveSupport::Notifications.subscribe('format_response.grape') do |_name, _start, _finish, _id, payload|
  if request_id = payload[:env]['action_dispatch.request_id']
    Peek.adapter.save(request_id)
  end
end