schwad_performance_logger 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a09f95f63c4a94034f5e95925f37b701898cb363d40b87b2098e017dab8eacb7
|
4
|
+
data.tar.gz: 044772f3bdd8e1a693fefde9e6d5d0850aeddf1060330a852881c29867767883
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a38e9dddf34713a281bd3f4f529b6c7d07b75103e6af4670833a6e176791e6659d4624dbc84e78be5facb360ffccefc286f322051ff00a1bdfe8038bb47e9a0
|
7
|
+
data.tar.gz: b908c98e3a999341e22525be3f274cd50f99f6be8d148e321f1b26f34a1a8d735d544492808dac33068c8313186621aa559d7f4f98f1d4576e78344fbb8bf095
|
@@ -26,17 +26,17 @@ class PLogger
|
|
26
26
|
log_performance('initialization')
|
27
27
|
end
|
28
28
|
|
29
|
-
def log_performance(memo = nil)
|
29
|
+
def log_performance(memo = nil, minimal: false)
|
30
30
|
if block_given?
|
31
31
|
update_checks
|
32
32
|
yield
|
33
33
|
update_checks
|
34
|
-
puts_performance("After: #{memo}", gblock: true) unless @options[:puts] == false
|
34
|
+
puts_performance("After: #{memo}", gblock: true, minimal: minimal) unless @options[:puts] == false
|
35
35
|
logger_performance("After: #{memo}") unless @options[:log] == false
|
36
36
|
csv_performance("After: #{memo}") unless @options[:csv] == false
|
37
37
|
else
|
38
38
|
update_checks
|
39
|
-
puts_performance(memo) unless @options[:puts] == false
|
39
|
+
puts_performance(memo, minimal: minimal) unless @options[:puts] == false
|
40
40
|
logger_performance(memo) unless @options[:log] == false
|
41
41
|
csv_performance(memo) unless @options[:csv] == false
|
42
42
|
end
|
@@ -47,11 +47,13 @@ class PLogger
|
|
47
47
|
|
48
48
|
private
|
49
49
|
|
50
|
-
def puts_performance(memo, gblock: false)
|
50
|
+
def puts_performance(memo, gblock: false, minimal: false)
|
51
51
|
separator = '*' * 80
|
52
52
|
puts "\e[34m#{separator}\e[0m"
|
53
53
|
puts "\e[32m#{memo}\e[0m"
|
54
|
-
if
|
54
|
+
if minimal
|
55
|
+
puts format_output_minimal
|
56
|
+
elsif gblock
|
55
57
|
puts format_output_block
|
56
58
|
else
|
57
59
|
puts format_output
|
@@ -106,4 +108,10 @@ class PLogger
|
|
106
108
|
\e[33mTime since last run:\e[0m #{@second_delta_time * 1000} milliseconds
|
107
109
|
OUTPUT
|
108
110
|
end
|
111
|
+
|
112
|
+
def format_output_minimal
|
113
|
+
<<~OUTPUT
|
114
|
+
#{@second_delta_time * 1000}ms
|
115
|
+
OUTPUT
|
116
|
+
end
|
109
117
|
end
|