memoir 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 +4 -4
- data/.travis.yml +0 -6
- data/lib/memoir/client.rb +5 -2
- data/lib/memoir/query.rb +5 -3
- data/lib/memoir/version.rb +1 -1
- data/memoir.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 748578685dce1adb5549a7dfbf90aae86bc91d74
|
4
|
+
data.tar.gz: eb15a682be6227a6496e4314ee5b2c7a5996b7e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cf7a1bea6c41ea9f133e2e56504762a0372344dcdde1fff1fc49f592022d87b6c3d0426510f9890c839d14368e2a2bdb8abe9662073abc23b7f53e1cd978f04
|
7
|
+
data.tar.gz: 4db3ade3fee3a633ed7a103a1f2637368e1a13dff2b3da303f8c2df74627314f48553735eaaa66abb3600c1f74fe8f94f571e5fde80b051ca58791844253bd9f
|
data/.travis.yml
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
3
|
rvm:
|
4
|
-
- 1.9.3
|
5
4
|
- 2.0.0
|
6
5
|
- 2.1
|
7
6
|
- 2.2.1
|
8
7
|
- ruby-head
|
9
|
-
- jruby-19mode
|
10
8
|
- jruby-head
|
11
9
|
|
12
10
|
jdk:
|
@@ -19,10 +17,6 @@ matrix:
|
|
19
17
|
- rvm: ruby-head
|
20
18
|
- rvm: jruby-head
|
21
19
|
exclude:
|
22
|
-
- rvm: 1.9.3
|
23
|
-
jdk: openjdk7
|
24
|
-
- rvm: 1.9.3
|
25
|
-
jdk: oraclejdk7
|
26
20
|
- rvm: 2.0.0
|
27
21
|
jdk: openjdk7
|
28
22
|
- rvm: 2.0.0
|
data/lib/memoir/client.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
class Memoir::Client
|
2
|
-
attr_accessor :host, :port, :connection, :logger
|
2
|
+
attr_accessor :host, :port, :connection, :timeout, :logger
|
3
3
|
|
4
4
|
API_QUERY_URL = '/api/query'.freeze
|
5
5
|
|
6
|
-
def initialize(host, port, logger = nil)
|
6
|
+
def initialize(host, port, logger = nil, options = {})
|
7
7
|
@host = host
|
8
8
|
@port = port
|
9
|
+
@timeout = options[:timeout] || 10
|
9
10
|
@logger = logger
|
10
11
|
prepare_connection
|
11
12
|
end
|
@@ -43,6 +44,8 @@ class Memoir::Client
|
|
43
44
|
builder.request :json
|
44
45
|
builder.response :json
|
45
46
|
builder.adapter Faraday.default_adapter
|
47
|
+
builder.options[:timeout] = @timeout
|
48
|
+
builder.options[:open_timeout] = @timeout
|
46
49
|
end
|
47
50
|
end
|
48
51
|
end
|
data/lib/memoir/query.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Memoir::Query
|
2
|
-
attr_accessor :aggregator, :metric, :rate, :rate_options, :downsample, :filters
|
2
|
+
attr_accessor :aggregator, :metric, :explicit_tags, :rate, :rate_options, :downsample, :filters
|
3
3
|
|
4
|
-
def initialize(aggregator, metric, downsample = nil, rate = false, rate_options = {})
|
4
|
+
def initialize(aggregator, metric, downsample = nil, explicit_tags = false, rate = false, rate_options = {})
|
5
5
|
@aggregator = aggregator
|
6
6
|
@metric = metric
|
7
7
|
@downsample = downsample
|
@@ -9,6 +9,7 @@ class Memoir::Query
|
|
9
9
|
@rate_options = rate_options
|
10
10
|
@tags = {}
|
11
11
|
@filters = []
|
12
|
+
@explicit_tags = explicit_tags
|
12
13
|
end
|
13
14
|
|
14
15
|
def <<(filter)
|
@@ -31,7 +32,8 @@ class Memoir::Query
|
|
31
32
|
hash = {
|
32
33
|
'aggregator' => aggregator,
|
33
34
|
'metric' => metric,
|
34
|
-
'rate' => rate
|
35
|
+
'rate' => rate,
|
36
|
+
'explicitTags' => explicit_tags
|
35
37
|
}
|
36
38
|
|
37
39
|
hash['rateOptions'] = rate_options unless rate_options.empty?
|
data/lib/memoir/version.rb
CHANGED
data/memoir.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
16
|
spec.require_paths = ['lib']
|
17
17
|
|
18
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
18
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
19
19
|
spec.add_development_dependency 'rake', '~> 10.0'
|
20
20
|
spec.add_development_dependency 'rspec'
|
21
21
|
spec.add_development_dependency 'simplecov', '~> 0.11'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memoir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Kimle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.
|
192
|
+
rubygems_version: 2.6.10
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: Client library for easy communication with OpenTSDB
|