graphite-api 0.0.1.2 → 0.0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/lib/graphite-api/client.rb +11 -6
- data/lib/graphite-api/reactor.rb +4 -0
- data/lib/graphite-api/version.rb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -24,11 +24,11 @@ Graphite client and utilities for ruby
|
|
24
24
|
)
|
25
25
|
|
26
26
|
# Simple:
|
27
|
-
client.
|
27
|
+
client.metrics("webServer.web01.loadAvg" => 10.7)
|
28
28
|
# => example.prefix.webServer.web01.loadAvg 10.7 time.now.stamp
|
29
29
|
|
30
30
|
# Multiple with time:
|
31
|
-
client.
|
31
|
+
client.metrics({
|
32
32
|
"webServer.web01.loadAvg" => 10.7,
|
33
33
|
"webServer.web01.memUsage" => 40
|
34
34
|
},Time.at(1326067060))
|
@@ -37,7 +37,7 @@ Graphite client and utilities for ruby
|
|
37
37
|
|
38
38
|
# Every 10 sec
|
39
39
|
client.every(10) do
|
40
|
-
client.
|
40
|
+
client.metrics("webServer.web01.uptime" => `uptime`.split.first.to_i)
|
41
41
|
end
|
42
42
|
|
43
43
|
client.join # wait...
|
data/lib/graphite-api/client.rb
CHANGED
@@ -11,11 +11,11 @@
|
|
11
11
|
# )
|
12
12
|
#
|
13
13
|
# # Simple:
|
14
|
-
# client.
|
14
|
+
# client.metrics("webServer.web01.loadAvg" => 10.7)
|
15
15
|
# # => example.prefix.webServer.web01.loadAvg 10.7 time.now.stamp
|
16
16
|
#
|
17
17
|
# # Multiple with time:
|
18
|
-
# client.
|
18
|
+
# client.metrics({
|
19
19
|
# "webServer.web01.loadAvg" => 10.7,
|
20
20
|
# "webServer.web01.memUsage" => 40
|
21
21
|
# },Time.at(1326067060))
|
@@ -24,7 +24,7 @@
|
|
24
24
|
#
|
25
25
|
# # Every 10 sec
|
26
26
|
# client.every(10) do
|
27
|
-
# client.
|
27
|
+
# client.metrics("webServer.web01.uptime" => `uptime`.split.first.to_i)
|
28
28
|
# end
|
29
29
|
#
|
30
30
|
# client.join # wait...
|
@@ -45,17 +45,22 @@ module GraphiteAPI
|
|
45
45
|
def add_metrics(m,time = Time.now)
|
46
46
|
buffer.push(:metric => m, :time => time)
|
47
47
|
end
|
48
|
-
|
48
|
+
alias :metrics :add_metrics
|
49
|
+
|
49
50
|
def join
|
50
51
|
sleep 0.1 while buffer.new_records?
|
51
52
|
end
|
52
53
|
|
54
|
+
def loop
|
55
|
+
Reactor.loop
|
56
|
+
end
|
57
|
+
|
53
58
|
def stop
|
54
|
-
Reactor
|
59
|
+
Reactor.stop
|
55
60
|
end
|
56
61
|
|
57
62
|
def every(frequency,&block)
|
58
|
-
Reactor
|
63
|
+
Reactor.every(frequency,&block)
|
59
64
|
end
|
60
65
|
|
61
66
|
protected
|
data/lib/graphite-api/reactor.rb
CHANGED
data/lib/graphite-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphite-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
16
|
-
requirement: &
|
16
|
+
requirement: &70126297227100 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 0.3.3
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70126297227100
|
25
25
|
description: Graphite API - A Simple ruby client, aggregator daemon and API tools
|
26
26
|
email: eran@kontera.com
|
27
27
|
executables:
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|
68
68
|
rubyforge_project: graphite-api
|
69
|
-
rubygems_version: 1.8.
|
69
|
+
rubygems_version: 1.8.17
|
70
70
|
signing_key:
|
71
71
|
specification_version: 3
|
72
72
|
summary: Graphite Ruby Client
|