yabeda-gc 0.1.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 +4 -4
- data/.github/workflows/lint.yml +23 -0
- data/.github/workflows/test.yml +27 -0
- data/.rubocop.yml +1 -1
- data/Gemfile +5 -7
- data/Gemfile.lock +37 -31
- data/README.md +5 -1
- data/lib/yabeda/gc/version.rb +1 -1
- data/lib/yabeda/gc.rb +10 -0
- data/yabeda-gc.gemspec +2 -1
- metadata +8 -6
- data/.github/workflows/main.yml +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c15161b50122262318a3fde5329b9c7ffa4ec75c4d358ae2248bd60007e7139
|
4
|
+
data.tar.gz: 9d343e04a8c27b38ada68a6b4a3b606b0defe8f4bfc603702b4959057083ea00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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 "
|
9
|
-
|
10
|
-
gem "rspec", "~> 3.0"
|
7
|
+
gem "yabeda", "~> 0.11" # Version with test adapter and RSpec matchers
|
11
8
|
|
12
|
-
gem "
|
13
|
-
|
14
|
-
gem "
|
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
|
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.
|
13
|
-
diff-lcs (1.
|
14
|
-
dry-initializer (3.
|
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.
|
17
|
-
parser (3.
|
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.
|
24
|
+
rainbow (3.1.1)
|
23
25
|
rake (13.0.3)
|
24
|
-
regexp_parser (2.
|
25
|
-
rexml (3.2.
|
26
|
-
rspec (3.
|
27
|
-
rspec-core (~> 3.
|
28
|
-
rspec-expectations (~> 3.
|
29
|
-
rspec-mocks (~> 3.
|
30
|
-
rspec-core (3.
|
31
|
-
rspec-support (~> 3.
|
32
|
-
rspec-expectations (3.
|
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.
|
35
|
-
rspec-mocks (3.
|
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.
|
38
|
-
rspec-support (3.
|
39
|
-
rubocop (1.
|
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.
|
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.
|
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.
|
49
|
-
parser (>=
|
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.
|
52
|
-
yabeda (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.
|
63
|
-
rubocop (~> 1.
|
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
|
|
data/lib/yabeda/gc/version.rb
CHANGED
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.
|
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
|
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:
|
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/
|
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.
|
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.
|
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
|
data/.github/workflows/main.yml
DELETED
@@ -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
|