prometheus_exporter 0.4.10 → 0.4.11

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: 76513391a1b288238f564b8666b029f8bb2f5806c4b1f6b68778c91686f66b90
4
- data.tar.gz: f9428ef3033541a757e73441ef6f280c8e67e8f2dd2573df7b26c29a71d6e866
3
+ metadata.gz: 3aacb5796a775ab5ed7c872419b7ac5c7726a0117b4e7d7bfc5c5048735b412f
4
+ data.tar.gz: f32c2d1bb20ce8c0385a9502ca547cb212c84057f7b22c67cd8380ef5e9fcc19
5
5
  SHA512:
6
- metadata.gz: 9a614cb0bbe415465f870b7c8e1a31025357a300025f72b366903e87a490f42812bbaf69a652a63248eb1fa2b2c5f0f35a549da148e3c9fc3b9f18c5f3624cd0
7
- data.tar.gz: fc5aa911f6ee0bff347b395dc3280abae1f0967e0f8f50f28f4bf6a83aadd780d66a2b9713e4c0ae7b0e83bb74a0fefb86f3e6966e238cd6837826a12dbc554c
6
+ metadata.gz: 82c365e49940fdcb8e75f1645a96816d0e84157a7dbe8988421e0852f3059d90e7ad54fc5c1ee718665a256b96b2c9e7229a18082666c7275e6620f69f73926f
7
+ data.tar.gz: 2a703b4d52c22d0a08e7ae0df5f66abed1d2e9487ebbf659bda5feefd9fdb7d61968bae3d634535991ce128c5f1d09095772d8947ea8f4d7694559142e7bdb5c
data/.travis.yml CHANGED
@@ -2,6 +2,11 @@ sudo: required
2
2
  language: ruby
3
3
  dist: trusty
4
4
  rvm:
5
- - 2.5.0
5
+ - 2.3
6
+ - 2.4
7
+ - 2.5
8
+ - 2.6
6
9
  before_install: gem install bundler -v 1.16.1
7
10
  before_script: sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
11
+
12
+ script: bundle exec rubocop && bundle exec rake
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 0.4.11 - 15-05-2019
2
+
3
+ - Fix: Handle stopping nil worker_threads in Client
4
+ - Dev: add frozen string literals
5
+
1
6
  0.4.10 - 29-04-2019
2
7
 
3
8
  - Fix: Custom label support for puma collector
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
data/Guardfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  guard :minitest do
2
4
  # with Minitest::Unit
3
5
  watch(%r{^test/(.*)\/?(.*)_test\.rb$})
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rake/testtask"
3
5
 
data/bench/bench.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../lib/prometheus_exporter'
2
4
  require_relative '../lib/prometheus_exporter/client'
3
5
  require_relative '../lib/prometheus_exporter/server'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'optparse'
4
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class MyCustomCollector < PrometheusExporter::Server::Collector
2
4
  def initialize
3
5
  @gauge1 = PrometheusExporter::Metric::Gauge.new("thing1", "I am thing 1")
@@ -124,7 +124,7 @@ module PrometheusExporter
124
124
  @mutex.synchronize do
125
125
  wait_for_empty_queue_with_timeout(wait_timeout_seconds)
126
126
  @worker_thread&.kill
127
- while @worker_thread.alive?
127
+ while @worker_thread&.alive?
128
128
  sleep 0.001
129
129
  end
130
130
  @worker_thread = nil
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PrometheusExporter::Instrumentation
2
4
  class DelayedJob
3
5
  JOB_CLASS_REGEXP = %r{job_class: (\w+:{0,2})+}.freeze
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # see https://samsaffron.com/archive/2017/10/18/fastest-way-to-profile-a-method-in-ruby
2
4
  module PrometheusExporter::Instrumentation; end
3
5
 
@@ -1,4 +1,6 @@
1
- require 'json'
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
2
4
 
3
5
  # collects stats from puma
4
6
  module PrometheusExporter::Instrumentation
@@ -30,7 +32,7 @@ module PrometheusExporter::Instrumentation
30
32
  def collect_puma_stats(metric)
31
33
  stats = JSON.parse(::Puma.stats)
32
34
 
33
- if stats.key? 'workers'
35
+ if stats.key?("workers")
34
36
  metric[:phase] = stats["phase"]
35
37
  metric[:workers_total] = stats["workers"]
36
38
  metric[:booted_workers_total] = stats["booted_workers"]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'raindrops'
3
5
  rescue LoadError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "instrumentation/process"
2
4
  require_relative "instrumentation/method_profiler"
3
5
  require_relative "instrumentation/sidekiq"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "metric/base"
2
4
  require_relative "metric/counter"
3
5
  require_relative "metric/gauge"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PrometheusExporter::Server
2
4
 
3
5
  # minimal interface to implement a customer collector
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PrometheusExporter::Server
2
4
  class DelayedJobCollector < TypeCollector
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PrometheusExporter::Server
2
4
  class HutchCollector < TypeCollector
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PrometheusExporter::Server
2
4
  class PumaCollector < TypeCollector
3
5
  PUMA_GAUGES = {
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'prometheus_exporter/client'
3
4
  require_relative '../instrumentation/unicorn'
4
5
 
5
6
  module PrometheusExporter::Server
6
- class RunnerException < StandardError; end;
7
- class WrongInheritance < RunnerException; end;
7
+ class RunnerException < StandardError; end
8
+ class WrongInheritance < RunnerException; end
8
9
 
9
10
  class Runner
10
11
  def initialize(options = {})
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PrometheusExporter::Server
2
4
  class SidekiqCollector < TypeCollector
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PrometheusExporter::Server
2
4
  class TypeCollector
3
5
  def type
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "metric"
2
4
  require_relative "server/type_collector"
3
5
  require_relative "server/web_collector"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PrometheusExporter
2
- VERSION = "0.4.10"
4
+ VERSION = "0.4.11"
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "prometheus_exporter/version"
2
4
  require "json"
3
5
  require "thread"
@@ -22,7 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = ["prometheus_exporter"]
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.add_development_dependency "bundler", "~> 1.16"
25
+ spec.add_development_dependency "rubocop", ">= 0.69"
26
+ spec.add_development_dependency "bundler", "> 1.16"
26
27
  spec.add_development_dependency "rake", "~> 10.0"
27
28
  spec.add_development_dependency "minitest", "~> 5.0"
28
29
  spec.add_development_dependency "guard", "~> 2.0"
metadata CHANGED
@@ -1,27 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus_exporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-29 00:00:00.000000000 Z
11
+ date: 2019-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.69'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0.69'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - "~>"
31
+ - - ">"
18
32
  - !ruby/object:Gem::Version
19
33
  version: '1.16'
20
34
  type: :development
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - "~>"
38
+ - - ">"
25
39
  - !ruby/object:Gem::Version
26
40
  version: '1.16'
27
41
  - !ruby/object:Gem::Dependency
@@ -146,7 +160,6 @@ extra_rdoc_files: []
146
160
  files:
147
161
  - ".gitignore"
148
162
  - ".rubocop.yml"
149
- - ".travis"
150
163
  - ".travis.yml"
151
164
  - CHANGELOG
152
165
  - CODE_OF_CONDUCT.md
data/.travis DELETED
@@ -1,9 +0,0 @@
1
- sudo: false
2
- dist: trusty
3
- language: ruby
4
- rvm:
5
- - 2.3
6
- - 2.4
7
- - 2.5
8
- - 2.6
9
- - jruby