edamame 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,22 +29,28 @@ Send Edamame questions to the "Infinite Monkeywrench mailing list":http://groups
29
29
 
30
30
  h2. Requirements and Installation
31
31
 
32
- h3. Get the Code
32
+ h2. Install
33
33
 
34
- We're still actively developing {{ site.gemname }}. The newest version is available via "Git":http://git-scm.com on "github:":http://github.com/mrflip/{{ site.gemname }}
34
+ ** "Main Install and Setup Documentation":http://mrflip.github.com/edamame/INSTALL.html **
35
35
 
36
- pre. $ git clone git://github.com/mrflip/{{ site.gemname }}
36
+ h3. Get the code
37
37
 
38
- A gem is available from "gemcutter:":http://gemcutter.org/gems/{{ site.gemname }}
38
+ We're still actively developing edamame. The newest version is available via "Git":http://git-scm.com on "github:":http://github.com/mrflip/edamame
39
39
 
40
- pre. $ sudo gem install {{ site.gemname }} --source=http://gemcutter.org
40
+ pre. $ git clone git://github.com/mrflip/edamame
41
+
42
+ A gem is available from "gemcutter:":http://gemcutter.org/gems/edamame
43
+
44
+ pre. $ sudo gem install edamame --source=http://gemcutter.org
41
45
 
42
46
  (don't use the gems.github.com version -- it's way out of date.)
43
47
 
44
- You can instead download this project in either "zip":http://github.com/mrflip/{{ site.gemname }}/zipball/master or "tar":http://github.com/mrflip/{{ site.gemname }}/tarball/master formats.
48
+ You can instead download this project in either "zip":http://github.com/mrflip/edamame/zipball/master or "tar":http://github.com/mrflip/edamame/tarball/master formats.
45
49
 
46
50
  h3. Get the Dependencies
47
51
 
52
+ To finish setting up, see the "detailed setup instructions":http://mrflip.github.com/edamame/INSTALL.html and then read the "usage notes":http://mrflip.github.com/edamame/usage.html
53
+
48
54
  * "beanstalkd 1.3,":http://xph.us/dist/beanstalkd/ "libevent 1.4,":http://monkey.org/~provos/libevent/ and "beanstalk-client":http://github.com/dustin/beanstalk-client
49
55
  * "Tokyo Tyrant,":http://tokyocabinet.sourceforge.net/tyrantdoc/ "Tokyo Tyrant Ruby libs,":http://tokyocabinet.sourceforge.net/tyrantrubydoc/ "Tokyo Cabinet,":http://tokyocabinet.sourceforge.net and "Tokyo Cabinet Ruby libs":http://tokyocabinet.sourceforge.net/tyrantdoc/
50
56
  * Gems: "wukong":http://mrflip.github.com/wukong and "monkeyshines":http://mrflip.github.com/monkeyshines
@@ -88,3 +94,19 @@ There's a **fuller set of docs** at "http://mrflip.github.com/edamame":http://mr
88
94
  ** http://railscasts.com/episodes/130-monitoring-with-god
89
95
  ** Some code for the god conf is inspired by that railscast, "this pastie,":http://pastie.textmate.org/private/ovgxu2ihoicli2ktrwtbew the "one from the god docs":http://god.rubyforge.org/, and "Configuring GMail notifiers in God":http://millarian.com/programming/ruby-on-rails/monitoring-thin-using-god-with-google-apps-notifications/
90
96
  ** Alternatives to God include (in order of complexity): "Monit,":http://mmonit.com/monit/ perhaps "with Munin;":http://www.howtoforge.com/server_monitoring_monit_munin "Cacti":http://www.cacti.net/ and "Hyperic":http://www.hyperic.com/
97
+
98
+ ---------------------------------------------------------------------------
99
+
100
+ <notextile><div class="toggle"></notextile>
101
+
102
+ h2. More info
103
+
104
+ h3. Credits
105
+
106
+ Edamame was written by "Philip (flip) Kromer":http://mrflip.com (flip@infochimps.org / "@mrflip":http://twitter.com/mrflip) for the "infochimps project":http://infochimps.org
107
+
108
+ h3. Help!
109
+
110
+ Send wuclan questions to the "Infinite Monkeywrench mailing list":http://groups.google.com/group/infochimps-code
111
+
112
+ <notextile></div></notextile>
@@ -2,6 +2,7 @@
2
2
  $: << File.dirname(__FILE__)+'/../../lib'
3
3
  require 'rubygems'
4
4
  require 'edamame'
5
+ require 'wukong/logger'
5
6
  require 'monkeyshines/monitor'
6
7
  require 'monkeyshines/utils/trollop'
7
8
  require File.dirname(__FILE__)+'/edamame_util_opts'
@@ -11,9 +12,9 @@ pq = Edamame::PersistentQueue.new( :tube => CONFIG[:tube],
11
12
  :store => { :type => 'TyrantStore', :uri => CONFIG[:store] }
12
13
  )
13
14
 
14
- periodic_log = Monkeyshines::Monitor::PeriodicLogger.new(:iters => 1000, :time => 30)
15
+ periodic_log = Monkeyshines::Monitor::PeriodicLogger.new(:iters => 100, :time => 30)
15
16
  pq.queue.empty_all do |job|
16
- periodic_log.periodically{ [ job.tube, job.priority, job.delay, job.scheduling, job.obj['key'] ] }
17
+ periodic_log.periodically{ [ job.tube, job.priority, job.delay, job.body ] }
17
18
  end
18
19
  pq.store.each do |key, val|
19
20
  pq.store.db.out key
@@ -16,6 +16,5 @@ pq = Edamame::PersistentQueue.new( :tube => CONFIG[:tube],
16
16
  periodic_log = Monkeyshines::Monitor::PeriodicLogger.new(:iters => 1, :time => 30)
17
17
  pq.load do |job|
18
18
  obj = job.obj rescue nil
19
-
20
19
  periodic_log.periodically{ [ pq.store.size, job.loggable, job.class, obj.inspect ] }
21
20
  end
@@ -47,6 +47,12 @@ class TyrantGod < GodProcess
47
47
  File.join(options[:db_dirname], basename)
48
48
  end
49
49
 
50
+ # create any directories required by the process
51
+ def mkdirs!
52
+ super
53
+ FileUtils.mkdir_p File.dirname(dbname)
54
+ end
55
+
50
56
  def start_command
51
57
  [
52
58
  options[:server_exe],
@@ -109,14 +109,16 @@ module Edamame
109
109
  curr_watches = beanstalk.list_tubes_watched.values.first
110
110
  beanstalk.use tube if tube
111
111
  beanstalk.watch tube if tube
112
- p ["emptying", tube, current_jobs]
112
+ print "emptying\t%-23s\t%7d\t" % [tube, current_jobs]
113
113
  loop do
114
114
  kicked = beanstalk.open_connections.map{|conxn| conxn.kick(20) }
115
115
  break if (current_jobs == 0) || (!beanstalk.peek_ready)
116
116
  qjob = reserve(5) or break
117
117
  yield qjob
118
+ print '.'
118
119
  qjob.delete
119
120
  end
121
+ print "\n"
120
122
  beanstalk.use curr_tube
121
123
  beanstalk.ignore tube if (! curr_watches.include?(tube))
122
124
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edamame
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip (flip) Kromer
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-12 00:00:00 -05:00
12
+ date: 2009-11-02 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -47,9 +47,8 @@ description: "Edamame combines the Beanstalk priority queue with a Tokyo Tyrant
47
47
  email: flip@infochimps.org
48
48
  executables:
49
49
  - edamame-nuke
50
- - edamame-ps
51
- - edamame-stats
52
50
  - edamame-sync
51
+ - edamame-stats
53
52
  extensions: []
54
53
 
55
54
  extra_rdoc_files: