sampling_prof 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 3d1357aece706366d12fac2c1670ded8f2bdd24f
4
- data.tar.gz: 12077ea8a42b5ca17c38df2875aab9c6234e9955
3
+ metadata.gz: 059734e60c5ca68ae9aee85c3903317177a9e8fd
4
+ data.tar.gz: dd0da433f98ac0552d97d5053a6de3dca5212db4
5
5
  SHA512:
6
- metadata.gz: 4fd426493b203256f040399daf7e3c69e3ce44b5428d420b6d70900036cc3cd5d8910d5f2e6d16c7db5ee40894ed4f8f156a5749fd23676cb6b9055bed166586
7
- data.tar.gz: 65c57574670f4385e0b9f68a994bc33c01766e18b4025ee768292a22a8954662e7cc58f2267dcfc9b276f8f7856f3860c9b4f77be10ef0c51ad1813a7bad01bd
6
+ metadata.gz: 0a3bc208fdb609d09ecce6cb69f3577577bf01add12da196ba54e7820a57bfc41670d91abe4a4cf93fbee7242d3061564a2cb71a992019b4460d98b40bb0001f
7
+ data.tar.gz: 2ad8352836bf838e9b51d6a2de42582a2e9cc315a513d9c36a6150313fb360f1fdc1041605d8c7145f984c28498cbfb08928afcab0c7f2694c4c979fd8d479e7
Binary file
data/lib/sampling_prof.rb CHANGED
@@ -9,13 +9,19 @@ class SamplingProf
9
9
 
10
10
  attr_writer :output_file
11
11
 
12
- def initialize(sampling_interval=0.1,
13
- multithreading=false,
14
- output_interval=nil, #sec
15
- &output_handler)
16
- self.sampling_interval = sampling_interval
17
- self.multithreading = multithreading
18
- self.output_interval = output_interval || (multithreading ? 60 : nil)
12
+ # options:
13
+ # sampling_interval: default to 0.1 second
14
+ # multithreading: default to false
15
+ # output_interval: default to (multithreading ? 60 : nil)
16
+ # &output_handler: default to write into output_file
17
+ def initialize(*args, &output_handler)
18
+ self.sampling_interval = args[0] || 0.1
19
+ self.multithreading = args[1] || false
20
+ if args.length > 2
21
+ self.output_interval = args[2]
22
+ else
23
+ self.output_interval = multithreading ? 60 : nil
24
+ end
19
25
  self.output_handler = block_given? ? output_handler : default_output_handler
20
26
  internal_initialize if respond_to?(:internal_initialize)
21
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sampling_prof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xiao Li
@@ -65,6 +65,6 @@ rubyforge_project:
65
65
  rubygems_version: 2.1.9
66
66
  signing_key:
67
67
  specification_version: 4
68
- summary: Simple sampling profiler on JRuby
68
+ summary: Simple sampling profiler for ruby
69
69
  test_files: []
70
70