mackerel-client 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -1
- data/VERSION +1 -1
- data/lib/mackerel/client.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 484eafb1d615ca3170a466e17a1faaeb79367337
|
4
|
+
data.tar.gz: 4dce1406131b8c9b2c6781263fd71b62a3fc7364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45071cc8bb854e41d34c88ace12165c725df742af6b7b7cd632c2fca5236c530e967c1aaa5ade3dbc49315286422441e87180620a81f42c66d8c6d18ea71afb5
|
7
|
+
data.tar.gz: fe36bddcd86ffdfbd46f1907d2e7a2c1b61d7084f09441f284b18cbdd15ff735216681f5fd251c5d50b76d6afff91fdeddb3f9780a71e57158b8f1bdac8111e1
|
data/.travis.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/mackerel/client.rb
CHANGED
@@ -11,8 +11,10 @@ module Mackerel
|
|
11
11
|
ERROR_MESSAGE_FOR_API_KEY_ABSENCE = "API key is absent. Set your API key in a environment variable called MACKEREL_APIKEY."
|
12
12
|
|
13
13
|
def initialize(args = {})
|
14
|
-
@origin
|
15
|
-
@api_key
|
14
|
+
@origin = args[:mackerel_origin] || 'https://mackerel.io'
|
15
|
+
@api_key = args[:mackerel_api_key] || raise(ERROR_MESSAGE_FOR_API_KEY_ABSENCE)
|
16
|
+
@timeout = args[:timeout] || 30 # Ref: apiRequestTimeout at mackerel-agent
|
17
|
+
@open_timeout = args[:open_timeout] || 30 # Ref: apiRequestTimeout at mackerel-agent
|
16
18
|
end
|
17
19
|
|
18
20
|
def post_host(host)
|
@@ -160,6 +162,8 @@ module Mackerel
|
|
160
162
|
faraday.response :logger if ENV['DEBUG']
|
161
163
|
faraday.adapter Faraday.default_adapter
|
162
164
|
faraday.options.params_encoder = Faraday::FlatParamsEncoder
|
165
|
+
faraday.options.timeout = @timeout
|
166
|
+
faraday.options.open_timeout = @open_timeout
|
163
167
|
end
|
164
168
|
end
|
165
169
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mackerel-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mackerel developer team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|