From 66c7f518974cf3e3c9d9914fe7dd5b89f216889b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9my=20Coutable?= <remy@rymai.me>
Date: Tue, 18 Jul 2017 13:56:36 +0200
Subject: [PATCH] Bump peek-performance_bar to 1.3.0 and get rid of a
 monkey-patch
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Rémy Coutable <remy@rymai.me>
---
 Gemfile                                       |  2 +-
 Gemfile.lock                                  |  4 ++--
 config/initializers/peek.rb                   |  4 ----
 .../peek_performance_bar_with_rack_body.rb    | 22 -------------------
 4 files changed, 3 insertions(+), 29 deletions(-)
 delete mode 100644 lib/gitlab/performance_bar/peek_performance_bar_with_rack_body.rb

diff --git a/Gemfile b/Gemfile
index abf9f323fb4..263ddf7c748 100644
--- a/Gemfile
+++ b/Gemfile
@@ -268,7 +268,7 @@ gem 'peek', '~> 1.0.1'
 gem 'peek-gc', '~> 0.0.2'
 gem 'peek-host', '~> 1.0.0'
 gem 'peek-mysql2', '~> 1.1.0', group: :mysql
-gem 'peek-performance_bar', '~> 1.2.1'
+gem 'peek-performance_bar', '~> 1.3.0'
 gem 'peek-pg', '~> 1.3.0', group: :postgres
 gem 'peek-rblineprof', '~> 0.2.0'
 gem 'peek-redis', '~> 1.2.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index a24636ad512..df14fbec2c6 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -553,7 +553,7 @@ GEM
       atomic (>= 1.0.0)
       mysql2
       peek
-    peek-performance_bar (1.2.1)
+    peek-performance_bar (1.3.0)
       peek (>= 0.1.0)
     peek-pg (1.3.0)
       concurrent-ruby
@@ -1029,7 +1029,7 @@ DEPENDENCIES
   peek-gc (~> 0.0.2)
   peek-host (~> 1.0.0)
   peek-mysql2 (~> 1.1.0)
-  peek-performance_bar (~> 1.2.1)
+  peek-performance_bar (~> 1.3.0)
   peek-pg (~> 1.3.0)
   peek-rblineprof (~> 0.2.0)
   peek-redis (~> 1.2.0)
diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb
index da8282ec924..a54d53cbbe2 100644
--- a/config/initializers/peek.rb
+++ b/config/initializers/peek.rb
@@ -26,7 +26,3 @@ class PEEK_DB_CLIENT
 end
 
 PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker
-
-class Peek::Views::PerformanceBar::ProcessUtilization
-  prepend ::Gitlab::PerformanceBar::PeekPerformanceBarWithRackBody
-end
diff --git a/lib/gitlab/performance_bar/peek_performance_bar_with_rack_body.rb b/lib/gitlab/performance_bar/peek_performance_bar_with_rack_body.rb
deleted file mode 100644
index d939a6ea18d..00000000000
--- a/lib/gitlab/performance_bar/peek_performance_bar_with_rack_body.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# This solves a bug with a X-Senfile header that wouldn't be set properly, see
-# https://github.com/peek/peek-performance_bar/pull/27
-module Gitlab
-  module PerformanceBar
-    module PeekPerformanceBarWithRackBody
-      def call(env)
-        @env = env
-        reset_stats
-
-        @total_requests += 1
-        first_request if @total_requests == 1
-
-        env['process.request_start'] = @start.to_f
-        env['process.total_requests'] = total_requests
-
-        status, headers, body = @app.call(env)
-        body = Rack::BodyProxy.new(body) { record_request }
-        [status, headers, body]
-      end
-    end
-  end
-end
-- 
GitLab