deimos 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/deimos/metrics/manager.rb +2 -6
- data/lib/deimos/status/runner.rb +1 -1
- data/lib/deimos/version.rb +1 -1
- data/lib/deimos.rb +13 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17a40f67812084407c499920df0764fc3be8c16510fec55c79878fd934beb2fb
|
4
|
+
data.tar.gz: 41f903f78686b74f7ca02b0790a20536f4cc1d4d8a8b013737169e391735ad5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a417d5ae7b6d65b48a3c7300c488a6fc6754500bc4cb9c129a6e49e6327841ae5fbfa122a91bc2ea8f81c6c4bfb816313e0df5e02ccac177851d3e82ff8774f
|
7
|
+
data.tar.gz: 4853ffa98525c602d4f492d89f891622c521ab2dd4819695cacf55d02b4a2e6dcdddd69904afe3044526d49d8ba7195e087c47d8fe12bc1c483f123cdcb65c20
|
data/Gemfile.lock
CHANGED
@@ -8,24 +8,20 @@ module Deimos
|
|
8
8
|
summary: Prometheus::Client::Summary
|
9
9
|
}
|
10
10
|
|
11
|
-
delegate :instrument, to: ActiveSupport::Notifications
|
11
|
+
delegate :instrument, :unsubscribe, to: ActiveSupport::Notifications
|
12
12
|
|
13
13
|
attr_reader :registry
|
14
14
|
def initialize(registry: Prometheus::Client.registry)
|
15
15
|
@registry = registry
|
16
16
|
end
|
17
17
|
|
18
|
-
def subscriptions
|
19
|
-
@subscriptions ||= []
|
20
|
-
end
|
21
|
-
|
22
18
|
def collectors
|
23
19
|
@collectors ||= {}
|
24
20
|
end
|
25
21
|
|
26
22
|
def subscribe(event_name, type:, label:, **kwargs, &block)
|
27
23
|
Deimos.logger.info "Metrics: Subscribed to #{event_name}..."
|
28
|
-
|
24
|
+
ActiveSupport::Notifications.subscribe(event_name) do |*args|
|
29
25
|
event = ActiveSupport::Notifications::Event.new(*args)
|
30
26
|
collector = register_collector!(event_name, type, label, kwargs)
|
31
27
|
if block_given?
|
data/lib/deimos/status/runner.rb
CHANGED
data/lib/deimos/version.rb
CHANGED
data/lib/deimos.rb
CHANGED
@@ -32,7 +32,7 @@ module Deimos
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def application
|
35
|
-
Rack::Builder.new do
|
35
|
+
@application ||= Rack::Builder.new do
|
36
36
|
Deimos.middleware.each { |m| use m }
|
37
37
|
run Rack::URLMap.new(Deimos.applications)
|
38
38
|
end
|
@@ -57,8 +57,8 @@ module Deimos
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def applications
|
60
|
-
|
61
|
-
|
60
|
+
load! unless loaded?
|
61
|
+
|
62
62
|
@applications ||= {
|
63
63
|
"/status" => Deimos::Endpoints::Status.new(status: status),
|
64
64
|
"/metrics" => Deimos::Endpoints::Metrics.new(metrics: metrics)
|
@@ -77,4 +77,14 @@ module Deimos
|
|
77
77
|
@logger ||= Huyegger::Logger.new(::Logger.new(STDOUT).tap {|x| x.level = config.log_level})
|
78
78
|
end
|
79
79
|
|
80
|
+
def load!
|
81
|
+
require 'deimos/endpoints/status'
|
82
|
+
require 'deimos/endpoints/metrics'
|
83
|
+
@loaded = true
|
84
|
+
end
|
85
|
+
|
86
|
+
def loaded?
|
87
|
+
@loaded
|
88
|
+
end
|
89
|
+
|
80
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deimos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Carlile
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|