ddstat 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/ddstat.gemspec +1 -1
- data/lib/ddstat.rb +3 -4
- data/lib/ddstat/ddstat.rb +5 -6
- data/lib/ddstat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzZhMWQzOTM5OWViOTc5OWExYWRhMGNhZjQyY2IwZGM2MjhmNmMwMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2ZjMTkzNzJiNDIyYzU2ODIwYjQ4ZTg2NTExNzU0YjFkZThlYTM4OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjViNjE0M2JmYzI3NmY4MWVmOGI3MWJkODQ0YmYzMGM1MzBhMmE5NmQzMzdi
|
10
|
+
NWM4NGQ2OTgzZWRjOWJiNjEyY2ZlYjc3YzFlZWE1YWM1ZmIxYjczOTg3OTBh
|
11
|
+
MjU1NDIzNDk2M2JiNTMwMDhlOGIyZDZiYjcyY2M4ODQzNGQxYzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDFjODhjZWY3NTZiNjYwNWMxOWNkZTQ0NDU2Y2MzZTI2Njk0ODBiN2VhZGUx
|
14
|
+
OWE2ODI3OGRkZjRhZmNhOTc4ZTBjOTZhODMxMGY5ZDRlMWU2YWRlNTgyNWRl
|
15
|
+
ZDRkM2Q4YzM5NWRmNDJmOTgwMzhmNTU1MDhiNzk4ODY2NDU5ZmM=
|
data/ddstat.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency '
|
21
|
+
spec.add_dependency 'dogapi'
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
23
23
|
spec.add_development_dependency 'rake'
|
24
24
|
end
|
data/lib/ddstat.rb
CHANGED
@@ -4,11 +4,10 @@ module Ddstat
|
|
4
4
|
end
|
5
5
|
end
|
6
6
|
|
7
|
-
require '
|
8
|
-
require 'net/http'
|
7
|
+
require 'dogapi'
|
9
8
|
require 'pty'
|
10
|
-
require 'time'
|
11
9
|
require 'socket'
|
10
|
+
require 'time'
|
11
|
+
require 'thread'
|
12
12
|
require 'ddstat/version'
|
13
13
|
require 'ddstat/ddstat'
|
14
|
-
require 'ddstat/ddclient'
|
data/lib/ddstat/ddstat.rb
CHANGED
@@ -6,7 +6,7 @@ class Ddstat::Ddstat
|
|
6
6
|
api_key = ENV['DD_API_KEY']
|
7
7
|
host = %x[hostname -f 2> /dev/null].strip
|
8
8
|
host = Socket.gethostname if host.empty?
|
9
|
-
@dog =
|
9
|
+
@dog = Dogapi::Client.new(api_key, nil, host)
|
10
10
|
end
|
11
11
|
|
12
12
|
def run
|
@@ -94,16 +94,15 @@ class Ddstat::Ddstat
|
|
94
94
|
Time.now
|
95
95
|
end
|
96
96
|
|
97
|
-
metrics = {}
|
98
|
-
|
99
97
|
field_values.each do |category, fields|
|
100
98
|
fields.each do |name, value|
|
101
99
|
metric_name = [PREFIX, category, name].join('.')
|
102
|
-
|
100
|
+
|
101
|
+
Thread.start do
|
102
|
+
@dog.emit_point(metric_name, value.to_f)
|
103
|
+
end
|
103
104
|
end
|
104
105
|
end
|
105
|
-
|
106
|
-
@dog.emit_series(date_time, metrics)
|
107
106
|
rescue Timeout::Error
|
108
107
|
# nothing to do
|
109
108
|
end
|
data/lib/ddstat/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddstat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
11
11
|
date: 2014-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: dogapi
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ! '>='
|