promenade 0.1.1 → 0.1.2

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: f7623122f1e7054e684064826e995acb44df8d056574b2c942a91d033d0a996a
4
- data.tar.gz: 6da50efcc35f572b65a8bb0d85380442cdaa7529f8250efc00386ad2a0eb6267
3
+ metadata.gz: d36577650a0efcbf0b561e4a2b09161e876a427487759cafa9c68738f3e1f4a7
4
+ data.tar.gz: 8efef4f8f00c43702bcc9f7ba8c44460b96e520d0b489baaa56d5a2c9e880a9b
5
5
  SHA512:
6
- metadata.gz: 7bd6eb7ade6531acfbabb050c7d93986a9af727256f02afaef949146c286ea70a54ea6039eb48a18c60aa5662610111557db83ef2ab653ae3ba93436e6eb72c8
7
- data.tar.gz: bf642c2d8e698be5d6d01b827472a1fbc65c7c6eb1db6ba5094e266b53339155b94454c73d1f0a3406b8fe9153728186d931c5cc16d79ff568ee377a92b60e53
6
+ metadata.gz: c19304c6ce8bc18f1274c3a6b25c99c59a51580e1f8832d3b5f6d05be02c421da675ffc950eda63e80e03ea55c27cc4db75ba9a42a8cd3c6524de85b8ab486c0
7
+ data.tar.gz: 10d3c975f0b5836166a00278b2c88c0f79fedd0d3e85b168c74aac1dc0086e23d084b25f0f657122cd6447a301379499acb40b210a96fdc4b081bf0dbbe4f2aa
data/Gemfile.lock CHANGED
@@ -1,9 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- promenade (0.1.1)
4
+ promenade (0.1.2)
5
5
  activesupport
6
6
  prometheus-client-mmap (~> 0.9.3)
7
+ rack
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
@@ -27,6 +28,7 @@ GEM
27
28
  ast (~> 2.4.0)
28
29
  powerpack (0.1.2)
29
30
  prometheus-client-mmap (0.9.3)
31
+ rack (2.0.5)
30
32
  rainbow (3.0.0)
31
33
  rake (10.5.0)
32
34
  rspec (3.7.0)
data/exe/promenade ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "promenade"
4
+ require "rack"
5
+ require "prometheus/client/rack/exporter"
6
+
7
+ app = Rack::Builder.app do
8
+ use Rack::Deflater
9
+ use ::Prometheus::Client::Rack::Exporter
10
+ run ->(_env) { [404, {}, ["visit /metrics for metrics"]] }
11
+ end
12
+
13
+ Rack::Handler::WEBrick.run app, Port: ENV.fetch("PORT", "9394")
@@ -0,0 +1,21 @@
1
+ require "prometheus/client"
2
+ require "prometheus/client/support/unicorn"
3
+
4
+ module Promenade
5
+ def self.root_dir
6
+ defined? Rails ? Rails.root : Dir.pwd
7
+ end
8
+
9
+ def self.multiprocess_files_dir
10
+ ENV.fetch("PROMETHEUS_MULTIPROC_DIR", File.join(root_dir, "tmp", "prometheus"))
11
+ end
12
+
13
+ def self.setup
14
+ Prometheus::Client.configure do |config|
15
+ config.multiprocess_files_dir = multiprocess_files_dir
16
+ config.pid_provider = Prometheus::Client::Support::Unicorn.method(:worker_pid_provider)
17
+ end
18
+ end
19
+ end
20
+
21
+ Promenade.setup
@@ -1,3 +1,3 @@
1
1
  module Promenade
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  end
data/lib/promenade.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require "promenade/version"
2
+ require "promenade/setup"
2
3
 
3
4
  module Promenade
4
- # Your code goes here...
5
5
  end
data/promenade.gemspec CHANGED
@@ -18,10 +18,13 @@ Gem::Specification.new do |spec|
18
18
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
19
  end
20
20
 
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
23
  spec.require_paths = ["lib"]
22
24
 
23
25
  spec.add_dependency "activesupport"
24
26
  spec.add_dependency "prometheus-client-mmap", "~> 0.9.3"
27
+ spec.add_dependency "rack"
25
28
 
26
29
  spec.add_development_dependency "bundler", "~> 1.16"
27
30
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promenade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Robinson
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies:
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.9.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: rack
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -111,7 +125,8 @@ dependencies:
111
125
  description:
112
126
  email:
113
127
  - edward-robinson@cookpad.com
114
- executables: []
128
+ executables:
129
+ - promenade
115
130
  extensions: []
116
131
  extra_rdoc_files: []
117
132
  files:
@@ -128,6 +143,7 @@ files:
128
143
  - Rakefile
129
144
  - bin/console
130
145
  - bin/setup
146
+ - exe/promenade
131
147
  - lib/promenade.rb
132
148
  - lib/promenade/helper.rb
133
149
  - lib/promenade/kafka.rb
@@ -138,6 +154,7 @@ files:
138
154
  - lib/promenade/kafka/producer_subscriber.rb
139
155
  - lib/promenade/kafka/subscriber.rb
140
156
  - lib/promenade/prometheus.rb
157
+ - lib/promenade/setup.rb
141
158
  - lib/promenade/version.rb
142
159
  - promenade.gemspec
143
160
  homepage: https://github.com/errm/promenade