daikon 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/daikon.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{daikon}
8
- s.version = "0.7.2"
8
+ s.version = "0.7.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nick Quaranto"]
@@ -27,9 +27,6 @@ Gem::Specification.new do |s|
27
27
  "Rakefile",
28
28
  "bin/daikon",
29
29
  "daikon.gemspec",
30
- "features/daikon.feature",
31
- "features/step_definitions/daikon_steps.rb",
32
- "features/support/env.rb",
33
30
  "lib/daikon.rb",
34
31
  "lib/daikon/client.rb",
35
32
  "lib/daikon/configuration.rb",
data/lib/daikon.rb CHANGED
@@ -26,5 +26,5 @@ require 'daikon/monitor'
26
26
  require 'daikon/redis_hacks'
27
27
 
28
28
  module Daikon
29
- VERSION = "0.7.2"
29
+ VERSION = "0.7.3"
30
30
  end
data/lib/daikon/client.rb CHANGED
@@ -33,6 +33,13 @@ module Daikon
33
33
  logger.info message if logger
34
34
  end
35
35
 
36
+ def exception(error)
37
+ log error.to_s
38
+ error.backtrace.each do |line|
39
+ log line
40
+ end
41
+ end
42
+
36
43
  def request(method, path, options = {})
37
44
  options[:method] = method.to_s.upcase
38
45
  options[:path] = path
@@ -63,7 +70,7 @@ module Daikon
63
70
  push :put, "/api/v1/commands/#{id}.json", {"response" => pretty.string.strip}
64
71
  end
65
72
  rescue *EXCEPTIONS => ex
66
- log ex.to_s
73
+ exception(ex)
67
74
  end
68
75
 
69
76
  def rotate_monitor(start, stop)
@@ -74,13 +81,13 @@ module Daikon
74
81
 
75
82
  push :post, "/api/v1/summaries.json", payload
76
83
  rescue *EXCEPTIONS => ex
77
- log ex.to_s
84
+ exception(ex)
78
85
  end
79
86
 
80
87
  def report_info
81
88
  push :post, "/api/v1/infos.json", redis.info
82
89
  rescue *EXCEPTIONS => ex
83
- log ex.to_s
90
+ exception(ex)
84
91
  end
85
92
 
86
93
  def evaluate_redis(command)
@@ -89,8 +96,7 @@ module Daikon
89
96
  begin
90
97
  Shellwords.shellwords(command.to_s)
91
98
  rescue Exception => e
92
- STDERR.puts e.message
93
- e.backtrace.each {|bt| STDERR.puts bt}
99
+ exception(e)
94
100
  return e.message
95
101
  end
96
102
  return "No command received." unless argv[0]
@@ -98,8 +104,7 @@ module Daikon
98
104
  begin
99
105
  execute_redis(argv)
100
106
  rescue Exception => e
101
- STDERR.puts e.message
102
- e.backtrace.each {|bt| STDERR.puts bt}
107
+ exception(e)
103
108
  e.message
104
109
  end
105
110
  end
data/lib/daikon/daemon.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Daikon
2
2
  class Daemon
3
- INFO_INTERVAL = ENV["INFO_INTERVAL"] || 5
3
+ INFO_INTERVAL = ENV["INFO_INTERVAL"] || 10
4
4
  SUMMARY_INTERVAL = ENV["SUMMARY_INTERVAL"] || 60
5
5
 
6
6
  def self.sleep_time=(sleep_time)
data/spec/daemon_spec.rb CHANGED
@@ -19,7 +19,7 @@ describe Daikon::Daemon do
19
19
  sleep 3.1
20
20
  Daikon::Daemon.run = false
21
21
  client.should have_received(:rotate_monitor)
22
- client.should have_received(:report_info).times(12)
22
+ client.should have_received(:report_info).times(6)
23
23
  end
24
24
  end
25
25
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 2
9
- version: 0.7.2
8
+ - 3
9
+ version: 0.7.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nick Quaranto
@@ -160,9 +160,6 @@ files:
160
160
  - Rakefile
161
161
  - bin/daikon
162
162
  - daikon.gemspec
163
- - features/daikon.feature
164
- - features/step_definitions/daikon_steps.rb
165
- - features/support/env.rb
166
163
  - lib/daikon.rb
167
164
  - lib/daikon/client.rb
168
165
  - lib/daikon/configuration.rb
@@ -1,9 +0,0 @@
1
- Feature: something something
2
- In order to something something
3
- A user something something
4
- something something something
5
-
6
- Scenario: something something
7
- Given inspiration
8
- When I create a sweet new gem
9
- Then everyone should see how awesome I am
File without changes
@@ -1,13 +0,0 @@
1
- require 'bundler'
2
- begin
3
- Bundler.setup(:default, :development)
4
- rescue Bundler::BundlerError => e
5
- $stderr.puts e.message
6
- $stderr.puts "Run `bundle install` to install missing gems"
7
- exit e.status_code
8
- end
9
-
10
- $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
11
- require 'daikon'
12
-
13
- require 'rspec/expectations'