ruby-prof 1.3.0-x64-mingw32 → 1.3.1-x64-mingw32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e7a5ed3eff6d7d963f459a572dd63561423abb6d8911076e086e3588befb37b
4
- data.tar.gz: b4bf7cc5ec23482ccbcb103b6c7ab87c8614da0076d6a43f4848d6cd8aee3178
3
+ metadata.gz: 806c0eb4c670c555d8db93891b8463b252c01d4ecc53352007d52faab3dc189a
4
+ data.tar.gz: 104d4c36f8b6c983197dd1f24241033f53357d50d6f8c04082e9ca8de28e3dca
5
5
  SHA512:
6
- metadata.gz: 4797da262fc687b47bea5c33bdcfdd102197afb8a3ff441b00a5444bc06de4deb83421569b6e8f815381a385e79edc08c4339b2d3ab26f9f7c920a155c00f080
7
- data.tar.gz: bc891673567736bef06b12eb72514425261a678ad9d33ad709835e1e1cffd265c4657ba436a2e28486a45fa35fd678117ac2a2882c564fbfb334eb1edcec3918
6
+ metadata.gz: 6f7f2a47b1d91fe60796abf2a7c3889232753be3ed44d8639199749cc6d620ea688b99145a52522f25f6ad7d997ed16afd17118fc93893a9c50bd9e614c5b74a
7
+ data.tar.gz: 554417600fb7e354648f24cabf27ccd122070772bef65900c8e26e62e2fb575f39aa8208ad3bf7ef5e7f0100701ed78c22306e9e61bce770cd9c970d525be979
data/CHANGES CHANGED
@@ -1,3 +1,8 @@
1
+ 1.3.1 (2020-03-11)
2
+ =====================
3
+ * Add max_percent and filter_by options to flat printer (Sean McGivern)
4
+ * Include binary in mingw64 build (Charlie Savage)
5
+
1
6
  1.3.0 (2020-02-22)
2
7
  =====================
3
8
  * Update C code to use newer RTypedData API versus older RData API.
Binary file
Binary file
@@ -17,11 +17,21 @@ module RubyProf
17
17
  @output = nil
18
18
  end
19
19
 
20
- # Returns the min_percent of total time a method must take to be included in a profiling report
20
+ # Returns the min_percent of time a method must take to be included in a profiling report
21
21
  def min_percent
22
22
  @options[:min_percent] || 0
23
23
  end
24
24
 
25
+ # Returns the max_percent of time a method can take to be included in a profiling report
26
+ def max_percent
27
+ @options[:max_percent] || 100
28
+ end
29
+
30
+ # Returns the method to filter methods by (when using min_percent and max_percent)
31
+ def filter_by
32
+ @options[:filter_by] || :self_time
33
+ end
34
+
25
35
  # Returns the time format used to show when a profile was run
26
36
  def time_format
27
37
  '%A, %B %-d at %l:%M:%S %p (%Z)'
@@ -29,8 +29,9 @@ module RubyProf
29
29
 
30
30
  sum = 0
31
31
  methods.each do |method|
32
- self_percent = (method.self_time / total_time) * 100
33
- next if self_percent < min_percent
32
+ percent = (method.send(filter_by) / total_time) * 100
33
+ next if percent < min_percent
34
+ next if percent > max_percent
34
35
 
35
36
  sum += method.self_time
36
37
  #self_time_called = method.called > 0 ? method.self_time/method.called : 0
@@ -1,3 +1,3 @@
1
1
  module RubyProf
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -65,4 +65,31 @@ class PrinterFlatTest < TestCase
65
65
  assert_sorted times
66
66
  end
67
67
  end
68
+
69
+ def test_flat_result_max_percent
70
+ printer = RubyProf::FlatPrinter.new(@result)
71
+
72
+ printer.print(output = '', max_percent: 1)
73
+ self_percents = flat_output_nth_column_values(output, 1).map(&:to_f)
74
+
75
+ assert self_percents.max < 1
76
+ end
77
+
78
+ def test_flat_result_filter_by_total_time
79
+ printer = RubyProf::FlatPrinter.new(@result)
80
+
81
+ printer.print(output = '', filter_by: :total_time, min_percent: 50)
82
+ total_times = flat_output_nth_column_values(output, 2).map(&:to_f)
83
+
84
+ assert (total_times.min / total_times.max) >= 0.5
85
+ end
86
+
87
+ def test_flat_result_filter_by_self_time
88
+ printer = RubyProf::FlatPrinter.new(@result)
89
+
90
+ printer.print(output = '', filter_by: :self_time, min_percent: 0.1)
91
+ self_percents = flat_output_nth_column_values(output, 1).map(&:to_f)
92
+
93
+ assert self_percents.min >= 0.1
94
+ end
68
95
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-prof
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Shugo Maeda, Charlie Savage, Roger Pack, Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-22 00:00:00.000000000 Z
11
+ date: 2020-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -99,6 +99,8 @@ files:
99
99
  - ext/ruby_prof/ruby_prof.h
100
100
  - ext/ruby_prof/vc/ruby_prof.sln
101
101
  - ext/ruby_prof/vc/ruby_prof.vcxproj
102
+ - lib/2.6.5/ruby_prof.so
103
+ - lib/2.7.0/ruby_prof.so
102
104
  - lib/ruby-prof.rb
103
105
  - lib/ruby-prof/assets/call_stack_printer.html.erb
104
106
  - lib/ruby-prof/assets/call_stack_printer.png
@@ -176,7 +178,7 @@ metadata:
176
178
  bug_tracker_uri: https://github.com/ruby-prof/ruby-prof/issues
177
179
  changelog_uri: https://github.com/ruby-prof/ruby-prof/blob/master/CHANGES
178
180
  documentation_uri: https://ruby-prof.github.io/
179
- source_code_uri: https://github.com/ruby-prof/ruby-prof/tree/v1.3.0
181
+ source_code_uri: https://github.com/ruby-prof/ruby-prof/tree/v1.3.1
180
182
  post_install_message:
181
183
  rdoc_options: []
182
184
  require_paths: