ddstat 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ddstat/ddstat.rb +14 -1
- data/lib/ddstat/version.rb +1 -1
- metadata +13 -5
- checksums.yaml +0 -15
data/lib/ddstat/ddstat.rb
CHANGED
@@ -11,6 +11,7 @@ class Ddstat::Ddstat
|
|
11
11
|
|
12
12
|
def run
|
13
13
|
rows, cols = curr_rows_cols
|
14
|
+
|
14
15
|
cmd = [
|
15
16
|
"stty rows #{rows}",
|
16
17
|
"stty cols #{cols}",
|
@@ -99,7 +100,7 @@ class Ddstat::Ddstat
|
|
99
100
|
metric_name = [PREFIX, category, name].join('.')
|
100
101
|
|
101
102
|
Thread.start do
|
102
|
-
@dog.emit_point(metric_name, value
|
103
|
+
@dog.emit_point(metric_name, expand_value(value), :timstamp => date_time)
|
103
104
|
end
|
104
105
|
end
|
105
106
|
end
|
@@ -116,4 +117,16 @@ class Ddstat::Ddstat
|
|
116
117
|
nv.strip.split(/\s+/, 2)[1]
|
117
118
|
end
|
118
119
|
end
|
120
|
+
|
121
|
+
def expand_value(value)
|
122
|
+
n = 0
|
123
|
+
|
124
|
+
case value
|
125
|
+
when /k\Z/ then n = 1
|
126
|
+
when /M\Z/ then n = 2
|
127
|
+
when /G\Z/ then n = 3
|
128
|
+
end
|
129
|
+
|
130
|
+
value.to_f * (1024 ** n)
|
131
|
+
end
|
119
132
|
end
|
data/lib/ddstat/version.rb
CHANGED
metadata
CHANGED
@@ -1,18 +1,20 @@
|
|
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.5
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Genki Sugawara
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-17 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: dogapi
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -27,6 +30,7 @@ dependencies:
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: bundler
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
35
|
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -41,6 +46,7 @@ dependencies:
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: rake
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
51
|
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
@@ -48,6 +54,7 @@ dependencies:
|
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
59
|
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
@@ -73,25 +80,26 @@ files:
|
|
73
80
|
homepage: https://bitbucket.org/winebarrel/ddstat
|
74
81
|
licenses:
|
75
82
|
- MIT
|
76
|
-
metadata: {}
|
77
83
|
post_install_message:
|
78
84
|
rdoc_options: []
|
79
85
|
require_paths:
|
80
86
|
- lib
|
81
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
82
89
|
requirements:
|
83
90
|
- - ! '>='
|
84
91
|
- !ruby/object:Gem::Version
|
85
92
|
version: '0'
|
86
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
87
95
|
requirements:
|
88
96
|
- - ! '>='
|
89
97
|
- !ruby/object:Gem::Version
|
90
98
|
version: '0'
|
91
99
|
requirements: []
|
92
100
|
rubyforge_project:
|
93
|
-
rubygems_version:
|
101
|
+
rubygems_version: 1.8.23
|
94
102
|
signing_key:
|
95
|
-
specification_version:
|
103
|
+
specification_version: 3
|
96
104
|
summary: A tool that send to Datadog the data while execute dstat
|
97
105
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
YzZhMWQzOTM5OWViOTc5OWExYWRhMGNhZjQyY2IwZGM2MjhmNmMwMw==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
N2ZjMTkzNzJiNDIyYzU2ODIwYjQ4ZTg2NTExNzU0YjFkZThlYTM4OA==
|
7
|
-
SHA512:
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YjViNjE0M2JmYzI3NmY4MWVmOGI3MWJkODQ0YmYzMGM1MzBhMmE5NmQzMzdi
|
10
|
-
NWM4NGQ2OTgzZWRjOWJiNjEyY2ZlYjc3YzFlZWE1YWM1ZmIxYjczOTg3OTBh
|
11
|
-
MjU1NDIzNDk2M2JiNTMwMDhlOGIyZDZiYjcyY2M4ODQzNGQxYzA=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NDFjODhjZWY3NTZiNjYwNWMxOWNkZTQ0NDU2Y2MzZTI2Njk0ODBiN2VhZGUx
|
14
|
-
OWE2ODI3OGRkZjRhZmNhOTc4ZTBjOTZhODMxMGY5ZDRlMWU2YWRlNTgyNWRl
|
15
|
-
ZDRkM2Q4YzM5NWRmNDJmOTgwMzhmNTU1MDhiNzk4ODY2NDU5ZmM=
|