rumx 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +5 -1
- data/examples/timer/my_bean.rb +1 -1
- data/lib/rumx/beans/timer.rb +6 -6
- metadata +1 -1
data/History.md
CHANGED
data/examples/timer/my_bean.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class MyBean
|
2
2
|
include Rumx::Bean
|
3
3
|
|
4
|
-
bean_attr_accessor :sleep_time, :float, 'Amount of time my measured block sleeps'
|
4
|
+
bean_attr_accessor :sleep_time, :float, 'Amount of time in seconds my measured block sleeps'
|
5
5
|
bean_attr_accessor :percent_failure, :integer, 'Percentage of time the measured block will fail'
|
6
6
|
bean_attr_embed :timer, 'Timer for our sleep action'
|
7
7
|
|
data/lib/rumx/beans/timer.rb
CHANGED
@@ -5,11 +5,11 @@ module Rumx
|
|
5
5
|
|
6
6
|
bean_attr_reader :total_count, :integer, 'Number of times the measured block has run'
|
7
7
|
bean_attr_reader :error_count, :integer, 'Number of times the measured block has raised an exception'
|
8
|
-
bean_attr_reader :total_time, :float, 'Total time
|
9
|
-
bean_attr_reader :max_time, :float, 'The maximum time for all the runs of the timed instruction'
|
10
|
-
bean_attr_reader :min_time, :float, 'The minimum time for all the runs of the timed instruction'
|
11
|
-
bean_attr_reader :last_time, :float, 'The time for the last run of the timed instruction'
|
12
|
-
bean_reader :avg_time, :float, 'The average time for all runs of the timed instruction'
|
8
|
+
bean_attr_reader :total_time, :float, 'Total time (msec) for all the runs of the timed instruction'
|
9
|
+
bean_attr_reader :max_time, :float, 'The maximum time (msec) for all the runs of the timed instruction'
|
10
|
+
bean_attr_reader :min_time, :float, 'The minimum time (msec) for all the runs of the timed instruction'
|
11
|
+
bean_attr_reader :last_time, :float, 'The time (msec) for the last run of the timed instruction'
|
12
|
+
bean_reader :avg_time, :float, 'The average time (msec) for all runs of the timed instruction'
|
13
13
|
bean_writer :reset, :boolean, 'Reset the times and counts to zero (Note that last_time and errors are not reset)'
|
14
14
|
bean_attr_embed_list :errors, 'List of the last occurring errors'
|
15
15
|
|
@@ -37,7 +37,7 @@ module Rumx
|
|
37
37
|
begin
|
38
38
|
yield
|
39
39
|
ensure
|
40
|
-
current_time = Time.now.to_f - start_time.to_f
|
40
|
+
current_time = (Time.now.to_f - start_time.to_f) * 1000.0
|
41
41
|
bean_synchronize do
|
42
42
|
@last_time = current_time
|
43
43
|
@total_count += 1
|