yabeda-gc 0.1.0 → 0.2.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: 0d791570b010726049073dfa6b79512bd81e31e9f87bd63ab617ca974175ecaa
4
- data.tar.gz: 46c3a1752ccd4129666a2ee05511caff406a9f4ed916ac79bd24ca7c06bed943
3
+ metadata.gz: 0c15161b50122262318a3fde5329b9c7ffa4ec75c4d358ae2248bd60007e7139
4
+ data.tar.gz: 9d343e04a8c27b38ada68a6b4a3b606b0defe8f4bfc603702b4959057083ea00
5
5
  SHA512:
6
- metadata.gz: b69650b1c4f941ee6919768818f58ae3ca874126298441b82a022fe92e5d885f9d05422b206e04432c32d54be5127f1c2a2f4a727193caf4c88389cbb50f159b
7
- data.tar.gz: 8debd642b5f52ee51c2598d41a237e2f0a34530d5543151d8a22d9e56932379b958e0d482ce7944dc9f7c8156f9acc03a79af221c8bc47e3ea396192eaf3b88e
6
+ metadata.gz: a97ed85bbf2991ba54bf7fe6e350ca06a90f8b3bd07f0f53a85fa3d61219203f6ec12920b8d30fcea96c1993dafcdbd8a004a82f43443f13e080a3204a70f6df
7
+ data.tar.gz: 86aec667687e9b97b7b95e08486135f37593be016916ea8e0baf4bc648e392ddea7fc9de63a3bc4142c4a43d76fe63844ff0f0591d18f6be85c398df2317f0b9
@@ -0,0 +1,23 @@
1
+ name: Linters
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - '**'
8
+ tags-ignore:
9
+ - 'v*'
10
+
11
+ jobs:
12
+ build:
13
+ name: Rubocop
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v3
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: 3.1
21
+ bundler-cache: true
22
+ - name: Run Rubocop
23
+ run: bundle exec rake rubocop
@@ -0,0 +1,27 @@
1
+ name: Tests
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - '**'
8
+ tags-ignore:
9
+ - 'v*'
10
+
11
+ jobs:
12
+ build:
13
+ name: "Ruby ${{ matrix.ruby }}"
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: ['2.7', '3.0', '3.1', head]
19
+ steps:
20
+ - uses: actions/checkout@v3
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby }}
25
+ bundler-cache: true
26
+ - name: Run tests via RSpec
27
+ run: bundle exec rake spec
data/.rubocop.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  AllCops:
3
- TargetRubyVersion: 2.4
3
+ TargetRubyVersion: 2.7
4
4
  NewCops: enable
5
5
 
6
6
  Style/StringLiterals:
data/Gemfile CHANGED
@@ -2,13 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # Specify your gem's dependencies in yabeda-gc.gemspec
6
5
  gemspec
7
6
 
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rspec", "~> 3.0"
7
+ gem "yabeda", "~> 0.11" # Version with test adapter and RSpec matchers
11
8
 
12
- gem "rubocop", "~> 1.7"
13
-
14
- gem "pry"
9
+ gem "pry", "~> 0.14"
10
+ gem "rake", "~> 13.0"
11
+ gem "rspec", "~> 3.11"
12
+ gem "rubocop", "~> 1.30"
data/Gemfile.lock CHANGED
@@ -1,66 +1,72 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yabeda-gc (0.1.0)
4
+ yabeda-gc (0.2.1)
5
5
  yabeda (~> 0.6)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
+ anyway_config (2.3.0)
11
+ ruby-next-core (>= 0.14.0)
10
12
  ast (2.4.2)
11
13
  coderay (1.1.3)
12
- concurrent-ruby (1.1.8)
13
- diff-lcs (1.4.4)
14
- dry-initializer (3.0.4)
14
+ concurrent-ruby (1.1.10)
15
+ diff-lcs (1.5.0)
16
+ dry-initializer (3.1.1)
15
17
  method_source (1.0.0)
16
- parallel (1.20.1)
17
- parser (3.0.0.0)
18
+ parallel (1.22.1)
19
+ parser (3.1.2.0)
18
20
  ast (~> 2.4.1)
19
21
  pry (0.14.0)
20
22
  coderay (~> 1.1)
21
23
  method_source (~> 1.0)
22
- rainbow (3.0.0)
24
+ rainbow (3.1.1)
23
25
  rake (13.0.3)
24
- regexp_parser (2.1.1)
25
- rexml (3.2.4)
26
- rspec (3.10.0)
27
- rspec-core (~> 3.10.0)
28
- rspec-expectations (~> 3.10.0)
29
- rspec-mocks (~> 3.10.0)
30
- rspec-core (3.10.1)
31
- rspec-support (~> 3.10.0)
32
- rspec-expectations (3.10.1)
26
+ regexp_parser (2.5.0)
27
+ rexml (3.2.5)
28
+ rspec (3.11.0)
29
+ rspec-core (~> 3.11.0)
30
+ rspec-expectations (~> 3.11.0)
31
+ rspec-mocks (~> 3.11.0)
32
+ rspec-core (3.11.0)
33
+ rspec-support (~> 3.11.0)
34
+ rspec-expectations (3.11.0)
33
35
  diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.10.0)
35
- rspec-mocks (3.10.2)
36
+ rspec-support (~> 3.11.0)
37
+ rspec-mocks (3.11.1)
36
38
  diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.10.0)
38
- rspec-support (3.10.2)
39
- rubocop (1.10.0)
39
+ rspec-support (~> 3.11.0)
40
+ rspec-support (3.11.0)
41
+ rubocop (1.30.1)
40
42
  parallel (~> 1.10)
41
- parser (>= 3.0.0.0)
43
+ parser (>= 3.1.0.0)
42
44
  rainbow (>= 2.2.2, < 4.0)
43
45
  regexp_parser (>= 1.8, < 3.0)
44
- rexml
45
- rubocop-ast (>= 1.2.0, < 2.0)
46
+ rexml (>= 3.2.5, < 4.0)
47
+ rubocop-ast (>= 1.18.0, < 2.0)
46
48
  ruby-progressbar (~> 1.7)
47
49
  unicode-display_width (>= 1.4.0, < 3.0)
48
- rubocop-ast (1.4.1)
49
- parser (>= 2.7.1.5)
50
+ rubocop-ast (1.18.0)
51
+ parser (>= 3.1.1.0)
52
+ ruby-next-core (0.15.1)
50
53
  ruby-progressbar (1.11.0)
51
- unicode-display_width (2.0.0)
52
- yabeda (0.8.0)
54
+ unicode-display_width (2.1.0)
55
+ yabeda (0.11.0)
56
+ anyway_config (>= 1.0, < 3)
53
57
  concurrent-ruby
54
58
  dry-initializer
55
59
 
56
60
  PLATFORMS
61
+ arm64-darwin-21
57
62
  x86_64-linux
58
63
 
59
64
  DEPENDENCIES
60
- pry
65
+ pry (~> 0.14)
61
66
  rake (~> 13.0)
62
- rspec (~> 3.0)
63
- rubocop (~> 1.7)
67
+ rspec (~> 3.11)
68
+ rubocop (~> 1.30)
69
+ yabeda (~> 0.11)
64
70
  yabeda-gc!
65
71
 
66
72
  BUNDLED WITH
data/README.md CHANGED
@@ -21,8 +21,9 @@ Or install it yourself as:
21
21
  ## Metrics
22
22
 
23
23
  | Metric | Description |
24
- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------- |
24
+ |-------------------------------------------|-----------------------------------------------------------------------------------------------------------|
25
25
  | `count` | Count of all GCs |
26
+ | `time` | The total time spent in garbage collections (ruby 3+) |
26
27
  | `minor_gc_count` | Count of minor GCs |
27
28
  | `major_gc_count` | Count of major GCs |
28
29
  | `heap_allocated_pages` | Total number of pages allocated for the heap |
@@ -47,6 +48,9 @@ Or install it yourself as:
47
48
  | `old_objects_limit` | Limit of old objects |
48
49
  | `oldmalloc_increase_bytes` | Total bytes allocated to old objects |
49
50
  | `oldmalloc_increase_bytes_limit` | Bytes limit that will trigger garbage collection of old objects |
51
+ | `compact_count` | Count of all GC compactions |
52
+ | `read_barrier_faults` | The total number of times the read barrier was triggered during compaction (ruby 3+) |
53
+ | `total_moved_objects` | The total number of objects compaction has moved (ruby 3+) |
50
54
 
51
55
  ## Development
52
56
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yabeda
4
4
  module GC
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
data/lib/yabeda/gc.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "yabeda"
4
+ require "yabeda/gc/version"
4
5
 
5
6
  module Yabeda
6
7
  # Yabeda plugin to capture important Ruby GC metrics
@@ -11,6 +12,7 @@ module Yabeda
11
12
  group :gc
12
13
 
13
14
  gauge :count, tags: [], comment: "Count of all GCs"
15
+ gauge :compact_count, tags: [], comment: "Count of all GC compactions"
14
16
  gauge :minor_gc_count, tags: [], comment: "Count of minor GCs"
15
17
  gauge :major_gc_count, tags: [], comment: "Count of major GCs"
16
18
  gauge :heap_allocated_pages, tags: [], comment: "Total number of pages allocated for the heap"
@@ -43,6 +45,14 @@ module Yabeda
43
45
  gauge :oldmalloc_increase_bytes_limit, tags: [],
44
46
  comment: "Bytes limit that will trigger garbage collection of old objects"
45
47
 
48
+ if RUBY_VERSION >= "3.0"
49
+ gauge :time, tags: [], comment: "The total time spent in garbage collections"
50
+ gauge :read_barrier_faults, tags: [], comment: "The total number of times the read barrier was triggered during compaction"
51
+ gauge :total_moved_objects, tags: [], comment: "The total number of objects compaction has moved"
52
+ end
53
+
54
+ gauge :time, tags: [], comment: "The total time spent in garbage collections" if RUBY_VERSION >= "3.1"
55
+
46
56
  collect do
47
57
  stats = ::GC.stat
48
58
 
data/yabeda-gc.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "Prometheus exporter for easy collecting of Ruby GC metrics"
13
13
  spec.homepage = "https://github.com/ianks/yabeda-gc"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
16
16
 
17
17
  # Specify which files should be added to the gem when it is released.
18
18
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ["lib"]
25
25
 
26
26
  spec.add_dependency "yabeda", "~> 0.6"
27
+ spec.metadata["rubygems_mfa_required"] = "true"
27
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yabeda-gc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2022-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yabeda
@@ -31,7 +31,8 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
- - ".github/workflows/main.yml"
34
+ - ".github/workflows/lint.yml"
35
+ - ".github/workflows/test.yml"
35
36
  - ".gitignore"
36
37
  - ".rspec"
37
38
  - ".rubocop.yml"
@@ -50,7 +51,8 @@ files:
50
51
  homepage: https://github.com/ianks/yabeda-gc
51
52
  licenses:
52
53
  - MIT
53
- metadata: {}
54
+ metadata:
55
+ rubygems_mfa_required: 'true'
54
56
  post_install_message:
55
57
  rdoc_options: []
56
58
  require_paths:
@@ -59,14 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
61
  requirements:
60
62
  - - ">="
61
63
  - !ruby/object:Gem::Version
62
- version: 2.4.0
64
+ version: 2.7.0
63
65
  required_rubygems_version: !ruby/object:Gem::Requirement
64
66
  requirements:
65
67
  - - ">="
66
68
  - !ruby/object:Gem::Version
67
69
  version: '0'
68
70
  requirements: []
69
- rubygems_version: 3.0.3
71
+ rubygems_version: 3.3.7
70
72
  signing_key:
71
73
  specification_version: 4
72
74
  summary: Extensible Prometheus exporter for monitoring Ruby gargage collection
@@ -1,18 +0,0 @@
1
- name: Ruby
2
-
3
- on: [push,pull_request]
4
-
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/checkout@v2
10
- - name: Set up Ruby
11
- uses: ruby/setup-ruby@v1
12
- with:
13
- ruby-version: 2.6.6
14
- - name: Run the default task
15
- run: |
16
- gem install bundler -v 2.2.11
17
- bundle install
18
- bundle exec rake