gruf-profiler 1.0.0 → 1.1.0

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
- SHA1:
3
- metadata.gz: c9c14f9f878d1d5ce008eebb556adc64de1cde19
4
- data.tar.gz: cf0e4090eb21bb266b796a89fb2b0d756c640355
2
+ SHA256:
3
+ metadata.gz: 8994d28b12babd1a73807ae1eeb1852a50694983315d99e7d29bd1a8e9ae9000
4
+ data.tar.gz: 175c8c9c9f7c1f93c6f9803216c034b59c2cb6ab7a4b69568ed8264172fea4c7
5
5
  SHA512:
6
- metadata.gz: fb30135dd11b0b76cc4e7ccc22fd19d4aefeea049af33d26495b59139f7e6a8818416b33346456da7f89d6eaa4102304016111a3808dc5aa14911eca63af9a1c
7
- data.tar.gz: c5b5907e9ad2790f8e9164c8866fd379bfcf7ce4d75d26e73af1e87edde8bd3eca47f51337e02f8ecb151bd36310fcda04d677161c944ce293a6e05ff381dbab
6
+ metadata.gz: a22e5d34669a6de110f0af38afd2eb2db701a89ba3769ce4089e09f7543445f5b41acd974d424d2e422bfdcb2b1dbe0e4930d37c949c6959ad58bd827750ade3
7
+ data.tar.gz: 2d920546627190e91b7c72611af90cb1d91bfef181be566e1dce92a72b2f3c30f96dc8d092d0b0629184c51a51d5eaafc6af962caf7c11c18991be944a229760
data/CHANGELOG.md CHANGED
@@ -1,15 +1,24 @@
1
1
  Changelog for the gruf-profiler gem.
2
2
 
3
- h3. 1.0.0
3
+ ### Unreleased Version
4
+
5
+ ### 1.1.0
6
+
7
+ - Add support for Ruby 3
8
+ - Loosen unnecessarily strict development dependencies
9
+ - Add bundler 2 support
10
+ - Update to Rubocop 1.0
11
+
12
+ ### 1.0.0
4
13
 
5
14
  - Support for gruf 2.0
6
15
 
7
- h3. 0.1.0
16
+ ### 0.1.0
8
17
 
9
18
  - Add rubocop
10
19
  - Add bundler-audit
11
20
  - Add configuration options for logging for memory profiler
12
21
 
13
- h3. 0.0.1
22
+ ### 0.0.1
14
23
 
15
24
  - Initial public release
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # gruf-profiler - Profiler for gruf
2
2
 
3
- [![Build Status](https://travis-ci.org/bigcommerce/gruf-profiler.svg?branch=master)](https://travis-ci.org/bigcommerce/gruf-profiler) [![Gem Version](https://badge.fury.io/rb/gruf-profiler.svg)](https://badge.fury.io/rb/gruf-profiler) [![Inline docs](http://inch-ci.org/github/bigcommerce/gruf-profiler.svg?branch=master)](http://inch-ci.org/github/bigcommerce/gruf-profiler)
3
+ [![CircleCI](https://circleci.com/gh/bigcommerce/gruf-profiler/tree/main.svg?style=svg)](https://circleci.com/gh/bigcommerce/gruf-profiler/tree/main) [![Gem Version](https://badge.fury.io/rb/gruf-profiler.svg)](https://badge.fury.io/rb/gruf-profiler) [![Inline docs](http://inch-ci.org/github/bigcommerce/gruf-profiler.svg?branch=main)](http://inch-ci.org/github/bigcommerce/gruf-profiler)
4
4
 
5
5
  Adds a profiler interceptor for [gruf](https://github.com/bigcommerce/gruf) 2.0.0 or later.
6
6
 
@@ -16,7 +16,7 @@ Then in an initializer or before use, after loading gruf:
16
16
  require 'gruf/profiler'
17
17
 
18
18
  Gruf.configure do |c|
19
- c.interceptors[Gruf::Profiler::Interceptor] = {}
19
+ c.interceptors.use(Gruf::Profiler::Interceptor)
20
20
  end
21
21
  ```
22
22
 
@@ -28,7 +28,7 @@ and [memory_profiler](https://github.com/SamSaffron/memory_profiler) gems by def
28
28
  ### rbtrace
29
29
 
30
30
  rbtrace is automatically loaded for every gruf service. You can view the
31
- [README](https://github.com/tmm1/rbtrace/blob/master/README.md) for rbtrace for more information,
31
+ [README](https://github.com/tmm1/rbtrace/blob/main/README.md) for rbtrace for more information,
32
32
  but the general idea is that you can run against a running gruf instance to see tracing
33
33
  information about a gruf server:
34
34
 
@@ -48,9 +48,7 @@ You can adjust that log level to say, INFO, like so:
48
48
 
49
49
  ```ruby
50
50
  Gruf.configure do |c|
51
- c.interceptors[Gruf::Profiler::Interceptor] = {
52
- log_level: :info
53
- }
51
+ c.interceptors.use(Gruf::Profiler::Interceptor, log_level: :info)
54
52
  end
55
53
  ```
56
54
 
@@ -1,4 +1,5 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
+
2
3
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
4
  #
4
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -14,7 +15,7 @@
14
15
  # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
16
  # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
17
  #
17
- $:.push File.expand_path("../lib", __FILE__)
18
+ $LOAD_PATH.unshift File.expand_path('lib', __dir__)
18
19
  require 'gruf/profiler/version'
19
20
 
20
21
  Gem::Specification.new do |spec|
@@ -23,20 +24,21 @@ Gem::Specification.new do |spec|
23
24
  spec.authors = ['Shaun McCormick']
24
25
  spec.email = ['shaun.mccormick@bigcommerce.com']
25
26
 
26
- spec.summary = %q{Plugin for profiling gruf-backed gRPC requests}
27
- spec.description = %q{Adds memory reporting and rbtrace to gruf servers}
27
+ spec.summary = 'Plugin for profiling gruf-backed gRPC requests'
28
+ spec.description = 'Adds memory reporting and rbtrace to gruf servers'
28
29
  spec.homepage = 'https://github.com/bigcommerce/gruf-profiler'
29
30
  spec.license = 'MIT'
30
31
 
31
32
  spec.files = Dir['README.md', 'CHANGELOG.md', 'CODE_OF_CONDUCT.md', 'lib/**/*', 'gruf-profiler.gemspec']
32
33
  spec.require_paths = ['lib']
33
34
 
34
- spec.add_development_dependency 'bundler', '~> 1.11'
35
- spec.add_development_dependency 'rake', '~> 10.0'
36
- spec.add_development_dependency 'rspec', '~> 3.6'
37
- spec.add_development_dependency 'pry', '~> 0'
35
+ spec.required_ruby_version = '>= 2.6'
36
+
37
+ spec.add_development_dependency 'pry', '>= 0.14'
38
+ spec.add_development_dependency 'rake', '>= 10.0'
39
+ spec.add_development_dependency 'rspec', '>= 3.8'
38
40
 
39
- spec.add_runtime_dependency 'stackprof', '~> 0'
40
- spec.add_runtime_dependency 'rbtrace', '~> 0'
41
- spec.add_runtime_dependency 'memory_profiler', '~> 0.9'
41
+ spec.add_runtime_dependency 'memory_profiler', '>= 0.9'
42
+ spec.add_runtime_dependency 'rbtrace', '>= 0.4'
43
+ spec.add_runtime_dependency 'stackprof', '>= 0.2'
42
44
  end
data/lib/gruf/profiler.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -24,7 +26,7 @@ module Gruf
24
26
  # Add to your gruf initializer:
25
27
  # require 'gruf/profiler'
26
28
  # Gruf.configure do |c|
27
- # c.interceptors[Gruf::Profiler::Interceptor] = {}
29
+ # c.interceptors.use(Gruf::Profiler::Interceptor)
28
30
  # end
29
31
  #
30
32
  class Interceptor < Gruf::Interceptors::ServerInterceptor
@@ -33,7 +35,7 @@ module Gruf
33
35
  #
34
36
  def call
35
37
  result = nil
36
- report = MemoryProfiler.report(memory_profiler_options) do
38
+ report = MemoryProfiler.report(**memory_profiler_options) do
37
39
  result = yield
38
40
  end
39
41
  if report
@@ -53,7 +55,7 @@ module Gruf
53
55
  #
54
56
  def profile(report)
55
57
  io_obj = pretty_print_options.fetch(:io, nil)
56
- report_string = io_obj ? report.pretty_print(io_obj, pretty_print_options) : report.pretty_print(pretty_print_options)
58
+ report_string = io_obj ? report.pretty_print(io_obj, **pretty_print_options) : report.pretty_print(**pretty_print_options)
57
59
  log("gruf profile for #{request.method_name}:\n#{report_string}")
58
60
  end
59
61
 
@@ -81,7 +83,7 @@ module Gruf
81
83
  # @return [Hash]
82
84
  #
83
85
  def pretty_print_options
84
- memory_profiler_options.fetch(:pretty_print_options, {})
86
+ memory_profiler_options.fetch(:pretty_print_options, {}) || {}
85
87
  end
86
88
  end
87
89
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -15,6 +17,6 @@
15
17
  #
16
18
  module Gruf
17
19
  module Profiler
18
- VERSION = '1.0.0'.freeze
20
+ VERSION = '1.1.0'
19
21
  end
20
22
  end
metadata CHANGED
@@ -1,113 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruf-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun McCormick
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-03 00:00:00.000000000 Z
11
+ date: 2021-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: pry
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: '0.14'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: '0.14'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '3.6'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.6'
55
- - !ruby/object:Gem::Dependency
56
- name: pry
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
45
+ - - ">="
60
46
  - !ruby/object:Gem::Version
61
- version: '0'
47
+ version: '3.8'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - "~>"
52
+ - - ">="
67
53
  - !ruby/object:Gem::Version
68
- version: '0'
54
+ version: '3.8'
69
55
  - !ruby/object:Gem::Dependency
70
- name: stackprof
56
+ name: memory_profiler
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - "~>"
59
+ - - ">="
74
60
  - !ruby/object:Gem::Version
75
- version: '0'
61
+ version: '0.9'
76
62
  type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - "~>"
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
- version: '0'
68
+ version: '0.9'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rbtrace
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - "~>"
73
+ - - ">="
88
74
  - !ruby/object:Gem::Version
89
- version: '0'
75
+ version: '0.4'
90
76
  type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - "~>"
80
+ - - ">="
95
81
  - !ruby/object:Gem::Version
96
- version: '0'
82
+ version: '0.4'
97
83
  - !ruby/object:Gem::Dependency
98
- name: memory_profiler
84
+ name: stackprof
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - "~>"
87
+ - - ">="
102
88
  - !ruby/object:Gem::Version
103
- version: '0.9'
89
+ version: '0.2'
104
90
  type: :runtime
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - "~>"
94
+ - - ">="
109
95
  - !ruby/object:Gem::Version
110
- version: '0.9'
96
+ version: '0.2'
111
97
  description: Adds memory reporting and rbtrace to gruf servers
112
98
  email:
113
99
  - shaun.mccormick@bigcommerce.com
@@ -126,7 +112,7 @@ homepage: https://github.com/bigcommerce/gruf-profiler
126
112
  licenses:
127
113
  - MIT
128
114
  metadata: {}
129
- post_install_message:
115
+ post_install_message:
130
116
  rdoc_options: []
131
117
  require_paths:
132
118
  - lib
@@ -134,16 +120,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
120
  requirements:
135
121
  - - ">="
136
122
  - !ruby/object:Gem::Version
137
- version: '0'
123
+ version: '2.6'
138
124
  required_rubygems_version: !ruby/object:Gem::Requirement
139
125
  requirements:
140
126
  - - ">="
141
127
  - !ruby/object:Gem::Version
142
128
  version: '0'
143
129
  requirements: []
144
- rubyforge_project:
145
- rubygems_version: 2.6.12
146
- signing_key:
130
+ rubygems_version: 3.2.16
131
+ signing_key:
147
132
  specification_version: 4
148
133
  summary: Plugin for profiling gruf-backed gRPC requests
149
134
  test_files: []