wavefront-client 1.0.2 → 1.0.3
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 +8 -8
- data/bin/wavefront-client +1 -1
- data/lib/wavefront/client/version.rb +1 -1
- data/lib/wavefront/client.rb +2 -1
- data/lib/wavefront/response.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTRlNTkwNWI5ODhjNTRiOWNjMTEyZGZiZGQ0Y2ZlZmRjNzM3NzMyNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTZlODRjMDBmY2UzNTYwZTNmZDRlZmFmNmY4N2NhZTU5ZTg3ZmJjMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTUxZjkzNjAwMDBlNTU4MmMwNTc4ZmMwM2E2N2MyMjk4MjRhYzRiZDNjZGM1
|
10
|
+
NmZkYmJiOTA3MTY0MDkxMDQ3ZmU2MjAxMDgyOTJhMmZiOTcwYjIwODQ2ZGM1
|
11
|
+
N2FiMTBhMWU1OGMxMjdhODNhZDNiYmVhZjE4OGY0ZjRmZTNmZjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGUyMDFhMzc3YjdkNzFhMmZiMGQxM2E2YmRlMGU4ZjUzMTM3MjFmNGU1NDM5
|
14
|
+
ZGU1OTUyNTU4NWM1MmNiOTdiZmU4OTU2MGE1ZjlhZjQxZjAzMWM3MTIyMjU2
|
15
|
+
NDk2OTcyNTU5ZjNkYjI3NjIwODM2NDNhOTcwMGE5MGYxZmNhMzg=
|
data/bin/wavefront-client
CHANGED
@@ -27,7 +27,7 @@ require 'json'
|
|
27
27
|
on 't', 'token=', 'Wavefront authentication token'
|
28
28
|
on 'e', 'end=', 'Time in UNIX epoch seconds to query to'
|
29
29
|
on 'f', 'format=', "Output format (#{Wavefront::Client::FORMATS.join(', ')})", default: Wavefront::Client::DEFAULT_FORMAT.to_s
|
30
|
-
on 'p', 'prefixlength=', 'The number of path elements to treat as a prefix when doing schema manipulations', default:
|
30
|
+
on 'p', 'prefixlength=', 'The number of path elements to treat as a prefix when doing schema manipulations', default: Wavefront::Client::DEFAULT_PREFIX_LENGTH
|
31
31
|
on 'h', 'help', 'Display this message'
|
32
32
|
end
|
33
33
|
|
data/lib/wavefront/client.rb
CHANGED
@@ -27,6 +27,7 @@ module Wavefront
|
|
27
27
|
DEFAULT_PERIOD_SECONDS = 600
|
28
28
|
DEFAULT_PATH = '/chart/api'
|
29
29
|
DEFAULT_FORMAT = :raw
|
30
|
+
DEFAULT_PREFIX_LENGTH = 1
|
30
31
|
FORMATS = [ :raw, :ruby, :graphite, :highcharts ]
|
31
32
|
GRANULARITIES = %w( s m h d )
|
32
33
|
|
@@ -43,7 +44,7 @@ module Wavefront
|
|
43
44
|
options[:end_time] ||= Time.now
|
44
45
|
options[:start_time] ||= options[:end_time] - DEFAULT_PERIOD_SECONDS
|
45
46
|
options[:response_format] ||= DEFAULT_FORMAT
|
46
|
-
options[:prefix_length] ||=
|
47
|
+
options[:prefix_length] ||= DEFAULT_PREFIX_LENGTH
|
47
48
|
|
48
49
|
[ options[:start_time], options[:end_time] ].each { |o| raise Wavefront::Exception::InvalidTimeFormat unless o.is_a?(Time) }
|
49
50
|
raise Wavefront::Exception::InvalidGranularity unless GRANULARITIES.include?(granularity)
|
data/lib/wavefront/response.rb
CHANGED
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|
14
14
|
|
15
15
|
=end
|
16
16
|
|
17
|
+
require 'wavefront/client'
|
17
18
|
require 'wavefront/client/version'
|
18
19
|
require 'wavefront/exception'
|
19
20
|
require 'wavefront/mixins'
|
@@ -57,7 +58,7 @@ module Wavefront
|
|
57
58
|
|
58
59
|
def initialize(response, options={})
|
59
60
|
super
|
60
|
-
options[:prefix_length] ||=
|
61
|
+
options[:prefix_length] ||= Wavefront::Client::DEFAULT_PREFIX_LENGTH
|
61
62
|
|
62
63
|
@graphite = Array.new
|
63
64
|
self.timeseries.each do |ts|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wavefront-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Pointer
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2015-
|
15
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|