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: 1cd2043d45f57759843573942457ed5c635fb32d911d0119178c798ca162ece9
4
- data.tar.gz: 79f240f10f256b9b04513385486b24e26da6d352dee79587ea8802ef41b517a1
3
+ metadata.gz: a09f95f63c4a94034f5e95925f37b701898cb363d40b87b2098e017dab8eacb7
4
+ data.tar.gz: 044772f3bdd8e1a693fefde9e6d5d0850aeddf1060330a852881c29867767883
5
5
  SHA512:
6
- metadata.gz: c2a1badb587b6c532a170a80fccef850f085ba38cfc6e9a15286eee90b97ee9f9778efd95ad166bf7978acbd4f0ba08040b2635e397749f581857c55944a7f62
7
- data.tar.gz: 7df45a0cebe6b180a4822c8046803d99219d09a99a6841fbb9517f2204c24d955767063bf787e76f3b43406528f75deec6838bd9a1a1204ef88997ed827dbde7
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 gblock
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
@@ -1,3 +1,3 @@
1
1
  module SchwadPerformanceLogger
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schwad_performance_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Schwaderer