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 CHANGED
@@ -24,11 +24,11 @@ Graphite client and utilities for ruby
24
24
  )
25
25
 
26
26
  # Simple:
27
- client.add_metrics("webServer.web01.loadAvg" => 10.7)
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.add_metrics({
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.add_metrics("webServer.web01.uptime" => `uptime`.split.first.to_i)
40
+ client.metrics("webServer.web01.uptime" => `uptime`.split.first.to_i)
41
41
  end
42
42
 
43
43
  client.join # wait...
@@ -11,11 +11,11 @@
11
11
  # )
12
12
  #
13
13
  # # Simple:
14
- # client.add_metrics("webServer.web01.loadAvg" => 10.7)
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.add_metrics({
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.add_metrics("webServer.web01.uptime" => `uptime`.split.first.to_i)
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::stop
59
+ Reactor.stop
55
60
  end
56
61
 
57
62
  def every(frequency,&block)
58
- Reactor::every(frequency,&block)
63
+ Reactor.every(frequency,&block)
59
64
  end
60
65
 
61
66
  protected
@@ -26,6 +26,10 @@ module GraphiteAPI
26
26
  shutdown_hooks << block
27
27
  end
28
28
 
29
+ def loop
30
+ EventMachine.reactor_thread.join
31
+ end
32
+
29
33
  private
30
34
 
31
35
  def start_reactor
@@ -1,5 +1,5 @@
1
1
  module GraphiteAPI
2
2
  class Version
3
- VERSION = "0.0.1.2"
3
+ VERSION = "0.0.1.3"
4
4
  end
5
5
  end
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.2
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-05-03 00:00:00.000000000 Z
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: &70179921763180 !ruby/object:Gem::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: *70179921763180
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.15
69
+ rubygems_version: 1.8.17
70
70
  signing_key:
71
71
  specification_version: 3
72
72
  summary: Graphite Ruby Client