yabeda-puma-plugin 0.5.0 → 0.6.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
2
  SHA256:
3
- metadata.gz: ea655ec09c4edd3459d19356df62760dbb70049b24a0e5ccfb69eed7d501ec7d
4
- data.tar.gz: 49cab44b0913f02a372473b3e8951a6c880020f3a22970c6f9cdadee7d3935ae
3
+ metadata.gz: 0e89900f2439ba78c8c813c423c1035133934fd7b727d355fe16be5416b40ef5
4
+ data.tar.gz: 1b99f6bebac908ad72fd85522b41823a42593262057cea0abb3c2c6dd9768501
5
5
  SHA512:
6
- metadata.gz: d68acb875bb1d793d0bf6c11f1df91313ec730bcf9984f362829586bdb7810e21b809c60980cf606feec93378957b218d046bb30ced55858f8cc704c3b073380
7
- data.tar.gz: e8e0c33afd4c639ef3abb25485bf2fb9a3598a288d07033ad64ebffd354335f17558aef856afc18d439fb03cf0c767026c9e348b31de6d1ff1cc91a653ca1c7e
6
+ metadata.gz: 2f586fcfa8cef7892afa68690c23cb6c73c70964bed54b0ce65d5434513490b91c133d2ef2e9709ad352dde50f6ebf1dea3c884e67b668737d8cfb0eb783c215
7
+ data.tar.gz: 97c8662a33acdd7102d90faa8725ee86269587c8c3f104dc49ae0621793c66e6f9f5ddf8660f0dbec11598e700dc97db32dcb51073c96384f4273baa20946ac6
@@ -21,16 +21,26 @@ jobs:
21
21
  git fetch --tags --force # Really fetch annotated tag. See https://github.com/actions/checkout/issues/290#issuecomment-680260080
22
22
  echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
23
23
  echo ::set-output name=subject::$(git for-each-ref $GITHUB_REF --format='%(contents:subject)')
24
+ # Extract changelog entries between this and previous version headers
25
+ escaped_version=$(echo ${GITHUB_REF#refs/tags/v} | sed -e 's/[]\/$*.^[]/\\&/g')
26
+ changelog=$(awk "BEGIN{inrelease=0} /## ${escaped_version}/{inrelease=1;next} /## [0-9]+\.[0-9]+\.[0-9]+/{inrelease=0;exit} {if (inrelease) print}" CHANGELOG.md)
24
27
  # Multiline body for release. See https://github.community/t/set-output-truncates-multiline-strings/16852/5
25
28
  BODY="$(git for-each-ref $GITHUB_REF --format='%(contents:body)')"
29
+ BODY="${BODY}"$'\n'"${changelog}"
26
30
  BODY="${BODY//'%'/'%25'}"
27
31
  BODY="${BODY//$'\n'/'%0A'}"
28
32
  BODY="${BODY//$'\r'/'%0D'}"
29
33
  echo "::set-output name=body::$BODY"
34
+ # Add pre-release option if tag name has any suffix after vMAJOR.MINOR.PATCH
35
+ if [[ ${GITHUB_REF#refs/tags/} =~ ^v[0-9]+\.[0-9]+\.[0-9]+.+ ]]; then
36
+ echo ::set-output name=prerelease::true
37
+ fi
30
38
  - name: Build gem
31
39
  run: gem build
40
+ - name: Calculate checksums
41
+ run: sha256sum yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem > SHA256SUM
32
42
  - name: Check version
33
- run: ls yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem
43
+ run: ls -l yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem
34
44
  - name: Create Release
35
45
  id: create_release
36
46
  uses: actions/create-release@v1
@@ -41,9 +51,8 @@ jobs:
41
51
  release_name: ${{ steps.tag.outputs.subject }}
42
52
  body: ${{ steps.tag.outputs.body }}
43
53
  draft: false
44
- prerelease: false
45
- - name: Upload Release Asset
46
- id: upload-release-asset
54
+ prerelease: ${{ steps.tag.outputs.prerelease }}
55
+ - name: Upload built gem as release asset
47
56
  uses: actions/upload-release-asset@v1
48
57
  env:
49
58
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -52,3 +61,22 @@ jobs:
52
61
  asset_path: yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem
53
62
  asset_name: yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem
54
63
  asset_content_type: application/x-tar
64
+ - name: Upload checksums as release asset
65
+ uses: actions/upload-release-asset@v1
66
+ env:
67
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68
+ with:
69
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
70
+ asset_path: SHA256SUM
71
+ asset_name: SHA256SUM
72
+ asset_content_type: text/plain
73
+ - name: Publish to GitHub packages
74
+ env:
75
+ GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
76
+ run: |
77
+ gem push yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem --host https://rubygems.pkg.github.com/${{ github.repository_owner }}
78
+ - name: Publish to RubyGems
79
+ env:
80
+ GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
81
+ run: |
82
+ gem push yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem
@@ -17,6 +17,7 @@ jobs:
17
17
  fail-fast: false
18
18
  matrix:
19
19
  include:
20
+ - ruby: 3.0
20
21
  - ruby: 2.7
21
22
  - ruby: 2.6
22
23
  - ruby: 2.5
data/CHANGELOG.md ADDED
@@ -0,0 +1,52 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+ ## 0.6.0 - 2021-02-05
9
+
10
+ ### Changed
11
+
12
+ - “Most recent” aggregation mode specified for all gauge metrics. [@botimer], [#16](https://github.com/yabeda-rb/yabeda-puma-plugin/pull/16)
13
+
14
+ ## 0.5.0 - 2020-11-13
15
+
16
+ ### Changed
17
+
18
+ - Start Yabeda exporter on `on_booted` hook to support Puma 4.x daemon mode. [@Envek], [#14](https://github.com/yabeda-rb/yabeda-puma-plugin/pull/14)
19
+
20
+ ## 0.4.0 - 2020-04-29
21
+
22
+ ### Added
23
+
24
+ - `yabeda_prometheus` plugin to allow metrics export on separate port. [@jwhitcraft], [#11](https://github.com/yabeda-rb/yabeda-puma-plugin/pull/11)
25
+
26
+ ## 0.3.0 - 2020-01-27
27
+
28
+ ### Added
29
+
30
+ - Support for yabeda 0.2 (required by prometheus-client 1.0). [@Envek]
31
+
32
+ ## 0.2.1 - 2019-12-16
33
+
34
+ ### Fixed
35
+
36
+ - Fix undefined method in TCP socket. [@Neznauy], [#7](https://github.com/yabeda-rb/yabeda-puma-plugin/pull/7)
37
+
38
+ ## 0.2.0 - 2019-12-12
39
+
40
+ ### Added
41
+
42
+ - Support for TCP puma control panel url. [@dsalahutdinov]
43
+
44
+ ## 0.1.0 - 2019-04-02
45
+
46
+ Initial release with basic metrics collection. [@dsalahutdinov]
47
+
48
+ [@botimer]: https://github.com/botimer "Noah Botimer"
49
+ [@jwhitcraft]: https://github.com/jwhitcraft "Jon Whitcraft"
50
+ [@Neznauy]: https://github.com/Neznauy "Aleksandr Shlyakov"
51
+ [@Envek]: https://github.com/Envek "Andrey Novikov"
52
+ [@dsalahutdinov]: https://github.com/dsalahutdinov "Dmitry Salahutdinov"
data/README.md CHANGED
@@ -134,6 +134,38 @@ docker-compose run app bundle exec rspec
134
134
 
135
135
  Bug reports and pull requests are welcome on GitHub at https://github.com/yabeda-rb/yabeda-puma-plugin.
136
136
 
137
+ ### Releasing
138
+
139
+ 1. Bump version number in `lib/yabeda/puma/plugin/version.rb`
140
+
141
+ In case of pre-releases keep in mind [rubygems/rubygems#3086](https://github.com/rubygems/rubygems/issues/3086) and check version with command like `Gem::Version.new(Yabeda::VERSION).to_s`
142
+
143
+ 2. Fill `CHANGELOG.md` with missing changes, add header with version and date.
144
+
145
+ 3. Make a commit:
146
+
147
+ ```sh
148
+ git add lib/yabeda/puma/plugin/version.rb CHANGELOG.md
149
+ version=$(ruby -r ./lib/yabeda/puma/plugin/version.rb -e "puts Gem::Version.new(Yabeda::Puma::Plugin::VERSION)")
150
+ git commit --message="${version}: " --edit
151
+ ```
152
+
153
+ 4. Create annotated tag:
154
+
155
+ ```sh
156
+ git tag v${version} --annotate --message="${version}: " --edit --sign
157
+ ```
158
+
159
+ 5. Fill version name into subject line and (optionally) some description (list of changes will be taken from changelog and appended automatically)
160
+
161
+ 6. Push it:
162
+
163
+ ```sh
164
+ git push --follow-tags
165
+ ```
166
+
167
+ 7. GitHub Actions will create a new release, build and push gem into RubyGems! You're done!
168
+
137
169
  ## License
138
170
 
139
171
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -15,15 +15,15 @@ Puma::Plugin.create do
15
15
  Yabeda.configure do
16
16
  group :puma
17
17
 
18
- gauge :backlog, tags: %i[index], comment: 'Number of established but unaccepted connections in the backlog'
19
- gauge :running, tags: %i[index], comment: 'Number of running worker threads'
20
- gauge :pool_capacity, tags: %i[index], comment: 'Number of allocatable worker threads'
21
- gauge :max_threads, tags: %i[index], comment: 'Maximum number of worker threads'
18
+ gauge :backlog, tags: %i[index], comment: 'Number of established but unaccepted connections in the backlog', aggregation: :most_recent
19
+ gauge :running, tags: %i[index], comment: 'Number of running worker threads', aggregation: :most_recent
20
+ gauge :pool_capacity, tags: %i[index], comment: 'Number of allocatable worker threads', aggregation: :most_recent
21
+ gauge :max_threads, tags: %i[index], comment: 'Maximum number of worker threads', aggregation: :most_recent
22
22
 
23
23
  if clustered
24
- gauge :workers, comment: 'Number of configured workers'
25
- gauge :booted_workers, comment: 'Number of booted workers'
26
- gauge :old_workers, comment: 'Number of old workers'
24
+ gauge :workers, comment: 'Number of configured workers', aggregation: :most_recent
25
+ gauge :booted_workers, comment: 'Number of booted workers', aggregation: :most_recent
26
+ gauge :old_workers, comment: 'Number of old workers', aggregation: :most_recent
27
27
  end
28
28
 
29
29
  collect do
@@ -1,7 +1,7 @@
1
1
  module Yabeda
2
2
  module Puma
3
3
  module Plugin
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
6
6
  end
7
7
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_runtime_dependency "yabeda", "~> 0.2"
24
+ spec.add_runtime_dependency "yabeda", "~> 0.5"
25
25
  spec.add_runtime_dependency "puma"
26
26
  spec.add_runtime_dependency "json"
27
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yabeda-puma-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salahutdinov Dmitry
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-13 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yabeda
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '0.5'
20
20
  type: :runtime
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: '0.2'
26
+ version: '0.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: puma
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -119,6 +119,7 @@ files:
119
119
  - ".github/workflows/test.yml"
120
120
  - ".gitignore"
121
121
  - ".rspec"
122
+ - CHANGELOG.md
122
123
  - Gemfile
123
124
  - LICENSE
124
125
  - LICENSE.txt