arya-mongrel_proctitle 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/mongrel_proctitle.rb +5 -18
  2. metadata +1 -1
@@ -12,11 +12,7 @@ module Mongrel
12
12
  @request_threads = []
13
13
  @queue_length = 0
14
14
  @request_count = 0
15
- @last_request_finished_at = Time.now.to_f
16
- @last_request_finished_in = nil
17
- @last_request_str = nil
18
- @slowest_finished_in = nil
19
- @slowest_request_str = nil
15
+
20
16
  @updater_thread = Thread.new do
21
17
  while true
22
18
  @mutex.synchronize do
@@ -55,15 +51,9 @@ module Mongrel
55
51
  @queue_length -= 1
56
52
  @request_count += 1
57
53
 
58
- @last_request_finished_in = Time.now.to_f - Thread.current[:arrived_at]
59
- @last_request_finished_at = Time.now.to_f
54
+ @last_time = Time.now.to_f - Thread.current[:arrived_at]
60
55
  @last_request_str = Thread.current[:request_str]
61
-
62
- if @slowest_finished_in.nil? || @slowest_finished_in < @last_request_finished_in
63
- @slowest_finished_in = @last_request_finished_in
64
- @slowest_request_str = @last_request_str
65
- end
66
-
56
+
67
57
  @request_threads.delete(Thread.current)
68
58
  set_request_list_title
69
59
  end
@@ -102,11 +92,8 @@ module Mongrel
102
92
 
103
93
  # Reports process as being idle.
104
94
  def set_idle
105
- str = "idle for #{time_delta_abbriv(Time.now.to_f - @last_request_finished_at)}"
106
- extra = []
107
- extra << "last #{time_delta_abbriv(@last_request_finished_in)} #{@last_request_str}" if @last_request_finished_in && @last_request_str
108
- extra << "slowest #{time_delta_abbriv(@slowest_finished_in)} #{@slowest_request_str}" if @slowest_finished_in && @slowest_request_str
109
- str << " [#{extra.join(", ")}]" unless extra.empty?
95
+ str = "idle#{' '*20}"
96
+ str << "[last #{time_delta_abbriv(@last_time)} #{@last_request_str}]" if @last_time && @last_request_str
110
97
  self.title = str
111
98
  end
112
99
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arya-mongrel_proctitle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arya Asemanfar