hystrix_metrics_sinatra 0.0.1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/hystrix_metrics_sinatra.gemspec +12 -0
- data/lib/sinatra/hystrix_metrics.rb +33 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: be2ed280774be407542cc113c0f8c9ef0950fffa005237eb7538e6adf42f9a68
|
4
|
+
data.tar.gz: 417165af17f471f1717b0cf6ccdbdeeaca7ca3e684c951450232c459bbfcded5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6a235feed9638d267b21361ea65c2e933f07ff8b3f021a48127916b9295b22284684781a39b992bfc7a73081df39c423c3a3785fb15c9374d22708fd7d2b77f6
|
7
|
+
data.tar.gz: 2a2cea0bbeac951320323fd289185e703ea0f63994f1b71d1f07dd64ae3700ae52e1f5c1d372dfa6c70124381e4bc6fb3dc24053edfda73cc6e404a06a14ff01
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'hystrix_metrics_sinatra'
|
3
|
+
s.version = '0.0.1'
|
4
|
+
s.author = 'Chris Mowforth'
|
5
|
+
s.email = 'chris@mowforth.com'
|
6
|
+
s.license = 'Apache-2.0'
|
7
|
+
s.homepage = 'https://github.com/m0wfo/hystrix_metrics_sinatra'
|
8
|
+
s.summary = 'Real-time Hystrix metrics for Sinatra apps'
|
9
|
+
s.platform = 'java'
|
10
|
+
|
11
|
+
s.files = Dir.glob('lib/**/*') + ['hystrix_metrics_sinatra.gemspec']
|
12
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Sinatra
|
2
|
+
|
3
|
+
module HystrixMetricsExtension
|
4
|
+
|
5
|
+
require 'hystrix_metrics/metric'
|
6
|
+
require 'hystrix_metrics/metric_server'
|
7
|
+
|
8
|
+
module Helpers
|
9
|
+
|
10
|
+
def record_metric(name, &block)
|
11
|
+
HystrixMetrics::Metric.new(name, block).execute
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
def metric_server(port, path="/metrics")
|
17
|
+
server = HystrixMetrics::MetricServer.new(port, path)
|
18
|
+
|
19
|
+
trap("INT") {
|
20
|
+
server.stop
|
21
|
+
}
|
22
|
+
|
23
|
+
server.start
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.registered(app)
|
27
|
+
app.helpers HystrixMetricsExtension::Helpers
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
register Sinatra::HystrixMetricsExtension
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hystrix_metrics_sinatra
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: java
|
6
|
+
authors:
|
7
|
+
- Chris Mowforth
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-11-05 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email: chris@mowforth.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- hystrix_metrics_sinatra.gemspec
|
20
|
+
- lib/sinatra/hystrix_metrics.rb
|
21
|
+
homepage: https://github.com/m0wfo/hystrix_metrics_sinatra
|
22
|
+
licenses:
|
23
|
+
- Apache-2.0
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.7.6
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: Real-time Hystrix metrics for Sinatra apps
|
45
|
+
test_files: []
|