fluent-rubyprof 0.2.0 → 0.3.0
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 +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/test.yml +35 -0
- data/CHANGELOG.md +8 -0
- data/fluent-rubyprof.gemspec +2 -2
- data/lib/fluent/rubyprof.rb +11 -7
- data/spec/fluent-rubyprof/rubyprof_spec.rb +1 -1
- metadata +9 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a93e852e23b76fb335eb0509f8416b9b5d23f56c0587335b57f980f8861664db
|
|
4
|
+
data.tar.gz: 6e8d15760e49c68617a559c20afe601ebb56b8004f05b7657602f6c5e6de2793
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74c53564eb11fa6106a55eff60ae33af6076b50dee9746a20ab02ecf5a38b1530aeee1b954d289d376a15935c2ce21cf420a7d9ba5b9ad36ac913d36594de837
|
|
7
|
+
data.tar.gz: ad6502de6da4146250f30c771bcaaa383f489959727e499d5b824fca9c2b73d10cd312620bf1bf96bcf73bb611437651ce8bbb28fe9d99c4f54d58145a0b5e6a
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [master]
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [master]
|
|
7
|
+
schedule:
|
|
8
|
+
- cron: '0 0 1 * *'
|
|
9
|
+
jobs:
|
|
10
|
+
ruby-versions:
|
|
11
|
+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
|
|
12
|
+
with:
|
|
13
|
+
engine: cruby
|
|
14
|
+
min_version: 2.7
|
|
15
|
+
build:
|
|
16
|
+
needs: ruby-versions
|
|
17
|
+
runs-on: ${{ matrix.os }}
|
|
18
|
+
strategy:
|
|
19
|
+
fail-fast: false
|
|
20
|
+
matrix:
|
|
21
|
+
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
|
|
22
|
+
exclude:
|
|
23
|
+
- ruby: head
|
|
24
|
+
os:
|
|
25
|
+
- ubuntu-latest
|
|
26
|
+
name: Ruby ${{ matrix.ruby }} ${{ matrix.os }}
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v6
|
|
29
|
+
- uses: ruby/setup-ruby@v1
|
|
30
|
+
with:
|
|
31
|
+
ruby-version: ${{ matrix.ruby }}
|
|
32
|
+
- name: unit testing
|
|
33
|
+
run: |
|
|
34
|
+
bundle install --jobs 4 --retry 3
|
|
35
|
+
bundle exec rake spec
|
data/CHANGELOG.md
CHANGED
data/fluent-rubyprof.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "fluent-rubyprof"
|
|
7
|
-
spec.version = "0.
|
|
7
|
+
spec.version = "0.3.0"
|
|
8
8
|
spec.authors = ["Naotoshi Seo"]
|
|
9
9
|
spec.email = ["sonots@gmail.com"]
|
|
10
10
|
spec.summary = %q{Tools for start/stop ruby-prof dynamically from outside of fluentd}
|
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
18
18
|
spec.require_paths = ["lib"]
|
|
19
19
|
|
|
20
|
-
spec.add_development_dependency "bundler"
|
|
20
|
+
spec.add_development_dependency "bundler"
|
|
21
21
|
spec.add_development_dependency "rake"
|
|
22
22
|
spec.add_development_dependency "rspec"
|
|
23
23
|
end
|
data/lib/fluent/rubyprof.rb
CHANGED
|
@@ -69,7 +69,7 @@ module Fluent
|
|
|
69
69
|
raise OptionParser::InvalidOption.new("`start` or `stop` must be specified as the 1st argument")
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
-
measure_modes = %w[PROCESS_TIME WALL_TIME
|
|
72
|
+
measure_modes = %w[PROCESS_TIME WALL_TIME ALLOCATIONS MEMORY]
|
|
73
73
|
unless measure_modes.include?(opts[:measure_mode])
|
|
74
74
|
raise OptionParser::InvalidOption.new("-m allows one of #{measure_modes.join(', ')}")
|
|
75
75
|
end
|
|
@@ -96,15 +96,19 @@ module Fluent
|
|
|
96
96
|
when 'start'
|
|
97
97
|
remote_code = <<-CODE
|
|
98
98
|
require 'ruby-prof'
|
|
99
|
-
RubyProf.measure_mode
|
|
100
|
-
|
|
99
|
+
$fluent_rubyprof_instance = RubyProf::Profile.new(measure_mode: RubyProf::#{opts[:measure_mode]})
|
|
100
|
+
$fluent_rubyprof_instance.start
|
|
101
101
|
CODE
|
|
102
102
|
when 'stop'
|
|
103
103
|
remote_code = <<-"CODE"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
require 'ruby-prof'
|
|
105
|
+
if defined?($fluent_rubyprof_instance) && $fluent_rubyprof_instance
|
|
106
|
+
result = $fluent_rubyprof_instance.stop
|
|
107
|
+
File.open('#{opts[:output]}', 'w') {|f|
|
|
108
|
+
RubyProf::#{PRINTERS[opts[:printer]]}.new(result).print(f)
|
|
109
|
+
}
|
|
110
|
+
$fluent_rubyprof_instance = nil
|
|
111
|
+
end
|
|
108
112
|
CODE
|
|
109
113
|
end
|
|
110
114
|
|
|
@@ -13,7 +13,7 @@ describe Fluent::Rubyprof do
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
it 'correct measure_mode' do
|
|
16
|
-
expect { Fluent::Rubyprof.new.parse_options(['start', '-m', '
|
|
16
|
+
expect { Fluent::Rubyprof.new.parse_options(['start', '-m', 'PROCESS_TIME']) }.not_to raise_error
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it 'incorrect measure_mode' do
|
metadata
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-rubyprof
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Naotoshi Seo
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bundler
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
|
-
- - "
|
|
16
|
+
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
18
|
+
version: '0'
|
|
20
19
|
type: :development
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
|
-
- - "
|
|
23
|
+
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
25
|
+
version: '0'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
27
|
name: rake
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -60,6 +59,8 @@ executables:
|
|
|
60
59
|
extensions: []
|
|
61
60
|
extra_rdoc_files: []
|
|
62
61
|
files:
|
|
62
|
+
- ".github/dependabot.yml"
|
|
63
|
+
- ".github/workflows/test.yml"
|
|
63
64
|
- ".gitignore"
|
|
64
65
|
- ".rspec"
|
|
65
66
|
- ".travis.yml"
|
|
@@ -78,7 +79,6 @@ homepage: https://github.com/sonots/fluent-rubyprof
|
|
|
78
79
|
licenses:
|
|
79
80
|
- MIT
|
|
80
81
|
metadata: {}
|
|
81
|
-
post_install_message:
|
|
82
82
|
rdoc_options: []
|
|
83
83
|
require_paths:
|
|
84
84
|
- lib
|
|
@@ -93,9 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
94
|
version: '0'
|
|
95
95
|
requirements: []
|
|
96
|
-
|
|
97
|
-
rubygems_version: 2.7.4
|
|
98
|
-
signing_key:
|
|
96
|
+
rubygems_version: 4.0.6
|
|
99
97
|
specification_version: 4
|
|
100
98
|
summary: Tools for start/stop ruby-prof dynamically from outside of fluentd
|
|
101
99
|
test_files:
|