frankenstein 1.1.1 → 1.2.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
- SHA256:
3
- metadata.gz: 2be2343dffb4827832f28e4fc8c78869ecee109640dae85077545e93b26b5a93
4
- data.tar.gz: 79e4fb7ed5d09bde5029ed5b9529a1e6424af15486d3176bb1548e74d5ffee7a
2
+ SHA1:
3
+ metadata.gz: f2e7a82ed23dd4f853c7d0eea1c8b0ac334977ec
4
+ data.tar.gz: f2431b5567a6086f2c9cafa07f6496d1039ebccb
5
5
  SHA512:
6
- metadata.gz: c5f473197c5f5352b0437d4c3e2e7ec0886c18ca228e26eb912408d80a39304fce89faa51439d4871d1c51c9ad3de2935f65b8325bcaab693647c9cff2510770
7
- data.tar.gz: 13157a537afc8c3b58ee31324bfe52327e860e0f84ef3edaef04bdfe1b6cecdb964081de7d18af6938039016587031e0f91f0b2b32b3969ca4d4b8cc8cf52a3e
6
+ metadata.gz: 942dafc43941ce8724b387116463f90128780d67e97ecfadd8dde579273c9477cf3bea3447244cf23cfeadf7e004ba23675392e1060dc8d2f9e9f1fdf64966b6
7
+ data.tar.gz: 1a64333bb6f7c0ff58eebaeca68a921647b01e763e36362a7a6c3994127a3b3a1ca091b888806b713dda7fe9062decf89c66f09d6a4f45f4f78ec4f35815b250
@@ -0,0 +1,24 @@
1
+ require 'frankenstein/collected_metric'
2
+
3
+ module Frankenstein
4
+ # Allow registration of metrics for Ruby VM statistics.
5
+ #
6
+ module RubyVMMetrics
7
+ # Register Ruby VM metrics.
8
+ #
9
+ # For every statistic provided by the Ruby VM under the module method
10
+ # `RubyVM.stat`, a metric is registered named `ruby_vm_<stat>`, which
11
+ # provides a dimensionless metric with the value of the statistic.
12
+ #
13
+ # @param registry [Prometheus::Client::Registry] specify the metrics
14
+ # registry in which to register the GC-related metrics.
15
+ #
16
+ def self.register(registry = Prometheus::Client.registry)
17
+ RubyVM.stat.each do |k, v|
18
+ Frankenstein::CollectedMetric.new(:"ruby_vm_#{k}", "Ruby VM parameter #{k}", registry: registry) do
19
+ { {} => RubyVM.stat[k] }
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -78,7 +78,7 @@ module Frankenstein
78
78
  @server_thread = Thread.new do
79
79
  @op_mutex.synchronize do
80
80
  begin
81
- wrapped_logger = Frankenstein::Server::WEBrickLogger.new(logger: @logger)
81
+ wrapped_logger = Frankenstein::Server::WEBrickLogger.new(logger: @logger, progname: "Frankenstein::Server")
82
82
  @server = WEBrick::HTTPServer.new(Logger: wrapped_logger, BindAddress: nil, Port: @port, AccessLog: [[wrapped_logger, WEBrick::AccessLog::COMMON_LOG_FORMAT]])
83
83
  @server.mount "/", Rack::Handler::WEBrick, app
84
84
  rescue => ex
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frankenstein
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-09 00:00:00.000000000 Z
11
+ date: 2018-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prometheus-client
@@ -231,6 +231,7 @@ files:
231
231
  - lib/frankenstein/process_metrics.rb
232
232
  - lib/frankenstein/request.rb
233
233
  - lib/frankenstein/ruby_gc_metrics.rb
234
+ - lib/frankenstein/ruby_vm_metrics.rb
234
235
  - lib/frankenstein/server.rb
235
236
  - lib/frankenstein/server/webrick_logger.rb
236
237
  homepage: https://github.com/discourse/frankenstein
@@ -252,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
253
  version: '0'
253
254
  requirements: []
254
255
  rubyforge_project:
255
- rubygems_version: 2.7.7
256
+ rubygems_version: 2.5.2.1
256
257
  signing_key:
257
258
  specification_version: 4
258
259
  summary: or, the Modern Prometheus