pipeline_toolkit 1.2.20 → 1.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,8 @@ module PipelineToolkit
|
|
15
15
|
attr_reader :start_time
|
16
16
|
attr_reader :mps
|
17
17
|
attr_reader :options
|
18
|
+
attr_reader :total_messages
|
19
|
+
attr_reader :average_mps
|
18
20
|
attr_accessor :structure
|
19
21
|
|
20
22
|
PIPE_PATH = "/tmp"
|
@@ -41,6 +43,8 @@ module PipelineToolkit
|
|
41
43
|
|
42
44
|
@structure = [description]
|
43
45
|
write_pid(options[:pid_path]) if options[:pid_path]
|
46
|
+
|
47
|
+
@total_messages = 0
|
44
48
|
|
45
49
|
reset_message_statistics
|
46
50
|
end
|
@@ -190,6 +194,7 @@ module PipelineToolkit
|
|
190
194
|
def calculate_message_statistics
|
191
195
|
@time_delta = Time.now - @prev_time
|
192
196
|
@mps = @count / @time_delta
|
197
|
+
@average_mps = @total_messages / uptime
|
193
198
|
reset_message_statistics
|
194
199
|
end
|
195
200
|
|
@@ -239,6 +244,7 @@ module PipelineToolkit
|
|
239
244
|
def write(message)
|
240
245
|
DefaultLogger.debug("MessageSubscriber#write(#{message.inspect})")
|
241
246
|
@count += 1
|
247
|
+
total_messages += 1
|
242
248
|
write_to_pipe(message)
|
243
249
|
end
|
244
250
|
|
@@ -48,11 +48,18 @@
|
|
48
48
|
<td>host:</td><td><%= hostname %></td>
|
49
49
|
</tr>
|
50
50
|
<tr>
|
51
|
-
<td>
|
51
|
+
<td>uptime:</td><td><%= uptime / 60 %>mins</td>
|
52
52
|
</tr>
|
53
53
|
<tr>
|
54
|
-
<td>
|
54
|
+
<td>total messages:</td><td><%= total_messages %></td>
|
55
|
+
</tr>
|
56
|
+
<tr>
|
57
|
+
<td>average mps:</td><td><%= "%.3f" % (average_mps || 0) %></td>
|
58
|
+
</tr>
|
59
|
+
<tr>
|
60
|
+
<td>current mps:</td><td><%= "%.3f" % (mps || 0) %></td>
|
55
61
|
</tr>
|
62
|
+
|
56
63
|
</table>
|
57
64
|
</div>
|
58
65
|
</body>
|
@@ -51,7 +51,9 @@ module PipelineToolkit
|
|
51
51
|
:host => @message_subscriber.hostname,
|
52
52
|
:structure => @message_subscriber.structure,
|
53
53
|
:throughput => @message_subscriber.mps,
|
54
|
-
:uptime => @message_subscriber.uptime
|
54
|
+
:uptime => @message_subscriber.uptime,
|
55
|
+
:total => @message_subscriber.total_messages,
|
56
|
+
:average_mps => @message_subscriber.average_mps
|
55
57
|
}
|
56
58
|
response.content = result.to_json
|
57
59
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
8
|
+
- 21
|
9
|
+
version: 1.2.21
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Aisha Fenton
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-06 00:00:00 +12:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|