pantheios-ruby 0.22.0.2 → 0.22.3
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.
- checksums.yaml +5 -5
- data/AUTHORS.md +21 -0
- data/CHANGES.md +337 -0
- data/CONTRIBUTING.md +36 -0
- data/EXAMPLES.md +11 -0
- data/FAQ.md +28 -0
- data/INSTALL.md +43 -0
- data/LICENSE +21 -20
- data/NEWS.md +65 -0
- data/README.md +134 -2
- data/Rakefile +21 -0
- data/SECURITY.md +23 -0
- data/TODO.md +29 -0
- data/examples/coloured_console_log_service.rb +1 -1
- data/examples/multiple_modules.md +1 -1
- data/examples/multiple_modules.rb +36 -36
- data/examples/simple_logging.md +1 -1
- data/examples/simple_logging.rb +1 -1
- data/examples/threshold_front_end.rb +1 -1
- data/lib/pantheios/api.rb +156 -155
- data/lib/pantheios/application_layer/param_name_list.rb +1 -0
- data/lib/pantheios/application_layer/stock_severity_levels.rb +110 -111
- data/lib/pantheios/application_layer.rb +6 -5
- data/lib/pantheios/core.rb +416 -415
- data/lib/pantheios/front_ends/threshold_front_end.rb +81 -81
- data/lib/pantheios/globals.rb +45 -45
- data/lib/pantheios/services/coloured_console_log_service.rb +96 -96
- data/lib/pantheios/services/common/console.rb +58 -57
- data/lib/pantheios/services/multiplexing_log_service.rb +151 -150
- data/lib/pantheios/services/null_log_service.rb +11 -11
- data/lib/pantheios/services/simple_console_log_service.rb +20 -20
- data/lib/pantheios/services/simple_file_log_service.rb +112 -113
- data/lib/pantheios/services/standard_log_service_adapter.rb +119 -119
- data/lib/pantheios/services.rb +1 -0
- data/lib/pantheios/util/process_util.rb +25 -24
- data/lib/pantheios/util/reflection_util.rb +14 -13
- data/lib/pantheios/util/thread_util.rb +50 -49
- data/lib/pantheios/util/version_util.rb +34 -33
- data/lib/pantheios/util.rb +1 -0
- data/lib/pantheios/version.rb +19 -19
- data/lib/pantheios.rb +12 -12
- data/test/performance/test_perf_simple_statements.rb +58 -58
- data/test/performance/test_perf_trace_variants.rb +43 -57
- data/test/scratch/log_rolling_by_period_daily.rb +3 -3
- data/test/scratch/log_rolling_by_size_and_depth.rb +3 -3
- data/test/scratch/log_using_blocks.rb +12 -12
- data/test/scratch/multiplexing_log_service.rb +32 -32
- data/test/unit/application_layer/tc_param_name_list.rb +13 -13
- data/test/unit/application_layer/tc_stock_severity_levels.rb +102 -102
- data/test/unit/core/tc_core_1.rb +24 -24
- data/test/unit/front_ends/tc_threshold_front_end.rb +65 -65
- data/test/unit/services/tc_multiplexing_log_service.rb +79 -79
- data/test/unit/services/tc_null_log_service.rb +42 -42
- data/test/unit/services/tc_simple_console_log_service.rb +70 -70
- data/test/unit/services/tc_simple_file_log_service.rb +146 -146
- data/test/unit/services/tc_standard_log_service_adapter.rb +94 -96
- data/test/unit/util/tc_process_util.rb +6 -6
- data/test/unit/util/tc_reflection_util.rb +20 -20
- data/test/unit/util/tc_thread_util.rb +46 -46
- data/test/unit/util/tc_version_util.rb +47 -47
- metadata +33 -12
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
|
|
2
3
|
module Pantheios
|
|
3
4
|
module Util
|
|
@@ -5,41 +6,41 @@ module Util
|
|
|
5
6
|
# process utilities
|
|
6
7
|
module ProcessUtil
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
#
|
|
10
|
+
# * *Options:*
|
|
11
|
+
# - +:style+:: (:script, :script_basename, :script_dirname, :script_realpath, :script_stem) directs
|
|
12
|
+
# the inference of the process name. If none specified, :script_stem is assumed
|
|
13
|
+
def self.derive_process_name dollar0 = nil, **options
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
dollar0 ||= $0
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
style = options[:style] || :script_stem
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
case style
|
|
20
|
+
when :script
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
dollar0
|
|
23
|
+
when :script_basename
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
File.basename(dollar0)
|
|
26
|
+
when :script_dirname
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
File.basename(File.realpath(File.dirname(dollar0)))
|
|
29
|
+
when :script_realpath
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
File.realpath(File.dirname(dollar0))
|
|
32
|
+
when :script_stem
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
bn = File.basename(dollar0)
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
bn =~ /\.rb$/ ? $` : bn
|
|
37
|
+
else
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
warn "#{self.class}##{__method__}: ignoring unrecognised type/value for ':style': '#{style}' (#{style.class})"
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
dollar0
|
|
42
|
+
end
|
|
43
|
+
end
|
|
43
44
|
|
|
44
45
|
end # module ProcessUtil
|
|
45
46
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
|
|
2
3
|
module Pantheios
|
|
3
4
|
module Util
|
|
@@ -5,27 +6,27 @@ module Util
|
|
|
5
6
|
# reflection utilities
|
|
6
7
|
module ReflectionUtil
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
module ReflectionUtil_Constants
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
ROOT_CLASSES = [ ::Object, ::BasicObject ]
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
# Obtains a list of all classes pertaining to +o+, excepting root
|
|
15
|
+
# objects (+::Object+ and +::BaseObject+).
|
|
16
|
+
def self.non_root_classes o
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
return [] if o.nil?
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
return self.non_root_classes o.class unless ::Class === o
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
return [] if ReflectionUtil_Constants::ROOT_CLASSES.any? { |c| c == o }
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
s = o.superclass
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
return [ o ] if ::Object == s
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
[ o ] + self.non_root_classes(s)
|
|
29
|
+
end
|
|
29
30
|
|
|
30
31
|
end # module ProcessUtil
|
|
31
32
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
|
|
2
3
|
module Pantheios
|
|
3
4
|
module Util
|
|
@@ -5,77 +6,77 @@ module Util
|
|
|
5
6
|
# threading utilities
|
|
6
7
|
module ThreadUtil
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
# Creates (if necessary) and sets the given thread's +thread_name+
|
|
10
|
+
# attribute to the given name
|
|
11
|
+
#
|
|
12
|
+
# === Signature
|
|
13
|
+
#
|
|
14
|
+
# * *Parameters:*
|
|
15
|
+
# - +t+ [Thread, nil] The thread to be named, or +nil+ if it should
|
|
16
|
+
# operate on the current (invoking) thread
|
|
17
|
+
# - +name+ [String] The thread's name
|
|
18
|
+
def self.set_thread_name t, name
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
t ||= Thread.current
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
class << t; attr_accessor :thread_name; end unless t.respond_to? :thread_name
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
t.thread_name = name
|
|
25
|
+
end
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
# Obtains the name of the calling thread
|
|
28
|
+
def self.get_thread_name t
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
t ||= Thread.current
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
return t.thread_name if t.respond_to? :thread_name
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
t.to_s
|
|
35
|
+
end
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
# Inclusion module for giving the included type the +thread_name+
|
|
38
|
+
# attribute
|
|
39
|
+
#
|
|
40
|
+
# If included into a thread type, or a thread instance, then
|
|
41
|
+
module ThreadName
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
def self.included receiver
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
if receiver < ::Thread
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
receiver.instance_eval do
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
define_method(:thread_name) { defined?(@thread_name) && @thread_name || self.to_s }
|
|
50
|
+
define_method(:thread_name=) { |name| @thread_name = name }
|
|
51
|
+
end
|
|
52
|
+
else
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
receiver.instance_eval do
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
define_method :thread_name do |name = (name_not_given_ = true)|
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
t = Thread.current
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
has_tn = t.respond_to? :thread_name
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
if name_not_given_
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
return t.thread_name if has_tn
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
t.to_s
|
|
67
|
+
else
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
class << t; attr_accessor :thread_name; end unless has_tn
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
t.thread_name = name
|
|
72
|
+
end
|
|
73
|
+
end
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
define_method(:thread_name=) { |name| thread_name name }
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
79
80
|
|
|
80
81
|
end # module ThreadUtil
|
|
81
82
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
|
|
2
3
|
module Pantheios
|
|
3
4
|
module Util
|
|
@@ -5,39 +6,39 @@ module Util
|
|
|
5
6
|
# version utilities
|
|
6
7
|
module VersionUtil
|
|
7
8
|
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
9
|
+
# Compares two version designators and returns a spaceship comparison
|
|
10
|
+
# result
|
|
11
|
+
#
|
|
12
|
+
# === Signature
|
|
13
|
+
#
|
|
14
|
+
# * *Parameters:*
|
|
15
|
+
# - +lhs+ [String, Array[Integer|String]] The left-hand comparand
|
|
16
|
+
# - +rhs+ [String, Array[Integer|String]] The right-hand comparand
|
|
17
|
+
#
|
|
18
|
+
# * *Returns:*
|
|
19
|
+
# - 0 if the two version designators represent exactly the same version
|
|
20
|
+
# - <0 if the +lhs+ version designator represents an earlier version
|
|
21
|
+
# than the +rhs+ version designator
|
|
22
|
+
# - >0 if the +lhs+ version designator represents a later version
|
|
23
|
+
# than the +rhs+ version designator
|
|
24
|
+
def self.version_compare lhs, rhs
|
|
25
|
+
|
|
26
|
+
lhs = lhs.split('.') if String === lhs
|
|
27
|
+
rhs = rhs.split('.') if String === rhs
|
|
28
|
+
|
|
29
|
+
lhs = lhs.map { |n| n.to_i }
|
|
30
|
+
rhs = rhs.map { |n| n.to_i }
|
|
31
|
+
|
|
32
|
+
if lhs.size < rhs.size
|
|
33
|
+
|
|
34
|
+
lhs += [ 0 ] * (rhs.size - lhs.size)
|
|
35
|
+
else
|
|
36
|
+
|
|
37
|
+
rhs += [ 0 ] * (lhs.size - rhs.size)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
lhs <=> rhs
|
|
41
|
+
end
|
|
41
42
|
end # module VersionUtil
|
|
42
43
|
|
|
43
44
|
end # module Util
|
data/lib/pantheios/util.rb
CHANGED
data/lib/pantheios/version.rb
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
# ######################################################################## #
|
|
3
|
-
# File:
|
|
3
|
+
# File: lib/pantheios/version.rb
|
|
4
4
|
#
|
|
5
|
-
# Purpose:
|
|
5
|
+
# Purpose: Version for Pantheios.Ruby library
|
|
6
6
|
#
|
|
7
|
-
# Created:
|
|
8
|
-
# Updated:
|
|
7
|
+
# Created: 2nd April 2011
|
|
8
|
+
# Updated: 30th August 2026
|
|
9
9
|
#
|
|
10
|
-
# Home:
|
|
10
|
+
# Home: https://github.com/synesissoftware/Pantheios.Ruby
|
|
11
11
|
#
|
|
12
|
-
# Author:
|
|
12
|
+
# Author: Matthew Wilson
|
|
13
13
|
#
|
|
14
|
-
# Copyright (c) 2019-
|
|
14
|
+
# Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
|
|
15
15
|
# Copyright (c) 2011-2019, Matthew Wilson and Synesis Software
|
|
16
16
|
# All rights reserved.
|
|
17
17
|
#
|
|
@@ -50,18 +50,18 @@
|
|
|
50
50
|
|
|
51
51
|
module Pantheios
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
# Current version of the Pantheios.Ruby library
|
|
54
|
+
VERSION = '0.22.3'
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
private
|
|
57
|
+
VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
|
|
58
|
+
public
|
|
59
|
+
# Major version of the Pantheios.Ruby library
|
|
60
|
+
VERSION_MAJOR = VERSION_PARTS_[0] # :nodoc:
|
|
61
|
+
# Minor version of the Pantheios.Ruby library
|
|
62
|
+
VERSION_MINOR = VERSION_PARTS_[1] # :nodoc:
|
|
63
|
+
# Revision version of the Pantheios.Ruby library
|
|
64
|
+
VERSION_REVISION = VERSION_PARTS_[2] # :nodoc:
|
|
65
65
|
|
|
66
66
|
end # module Pantheios
|
|
67
67
|
|
data/lib/pantheios.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
# The main module for Pantheios
|
|
3
3
|
#
|
|
4
4
|
# Pantheios is both a namespace module and an inclusion module. When
|
|
@@ -19,21 +19,21 @@ require 'pantheios/version'
|
|
|
19
19
|
|
|
20
20
|
module Pantheios
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
# @!visibility private
|
|
23
|
+
def self.included receiver # :nodoc:
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
if ::Pantheios::Globals.HAS_CASCADED_INCLUDES
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
receiver.class_eval do
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
include ::Pantheios::API
|
|
30
|
+
include ::Pantheios::ApplicationLayer
|
|
31
|
+
include ::Pantheios::Util
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
::Pantheios::Core.register_include self, receiver
|
|
36
|
+
end
|
|
37
37
|
|
|
38
38
|
end # module Pantheios
|
|
39
39
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Purpose: COMPLETE_ME
|
|
7
7
|
#
|
|
8
8
|
# Created: 22nd January 2018
|
|
9
|
-
# Updated:
|
|
9
|
+
# Updated: 28th August 2026
|
|
10
10
|
#
|
|
11
11
|
# Author: Matthew Wilson
|
|
12
12
|
#
|
|
@@ -31,102 +31,102 @@ N = 5000000
|
|
|
31
31
|
|
|
32
32
|
def severity_logged? severity
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
return false
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
Benchmark.benchmark(Benchmark::CAPTION, 24, Benchmark::FORMAT, 'total:', 'avg:') do |r|
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
totals = []
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
totals << r.report("arguments (1-arg)") do
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
N.times do
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
log :notice, 'the cat in the hat.'
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
totals << r.report("blocks (1-arg)") do
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
N.times do
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
log(:notice) { 'the cat in the hat!' }
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
totals << r.report("args-if (1-arg)") do
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
N.times do
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
log :notice, 'the cat in the hat.' if severity_logged? :notice
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
totals << r.report("arguments (simple)") do
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
N.times do
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
log :notice, 'the ', 'cat ', 'in ', 'the ', 'hat.'
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
totals << r.report("blocks (simple)") do
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
N.times do
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
log(:notice) { 'the ' + 'cat ' + 'in ' + 'the ' + 'hat!' }
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
totals << r.report("args-if (simple)") do
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
N.times do
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
log :notice, 'the ', 'cat ', 'in ', 'the ', 'hat.' if severity_logged? :notice
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
90
|
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
totals << r.report("arguments (complex)") do
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
cat = 'cat'
|
|
95
|
+
hat = :hat
|
|
96
|
+
t = Time.now
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
N.times do
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
log :notice, "the #{cat} in the #{hat} (#{t})"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
totals << r.report("blocks (complex)") do
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
cat = 'cat'
|
|
107
|
+
hat = :hat
|
|
108
|
+
t = Time.now
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
N.times do
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
log(:notice) { "the #{cat} in the #{hat} (#{t})" }
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
totals << r.report("args-if (complex)") do
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
cat = 'cat'
|
|
119
|
+
hat = :hat
|
|
120
|
+
t = Time.now
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
N.times do
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
log :notice, "the #{cat} in the #{hat} (#{t})" if severity_logged? :notice
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
[ totals.inject(:+), totals.inject(:+) / totals.size ]
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
|