skynet 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. data/History.txt +49 -0
  2. data/Manifest.txt +84 -6
  3. data/README.txt +75 -64
  4. data/app_generators/skynet_install/skynet_install_generator.rb +14 -8
  5. data/app_generators/skynet_install/templates/migration.rb +1 -24
  6. data/app_generators/skynet_install/templates/skynet_config.rb +50 -0
  7. data/app_generators/skynet_install/templates/skynet_initializer.rb +1 -0
  8. data/app_generators/skynet_install/templates/{skynet_schema.sql → skynet_mysql_schema.sql} +1 -24
  9. data/bin/skynet +37 -10
  10. data/bin/skynet_install +5 -5
  11. data/bin/skynet_tuplespace_server +27 -19
  12. data/examples/dgrep/README +70 -0
  13. data/examples/dgrep/config/skynet_config.rb +26 -0
  14. data/examples/dgrep/data/shakespeare/README +2 -0
  15. data/examples/dgrep/data/shakespeare/poetry/loverscomplaint +381 -0
  16. data/examples/dgrep/data/shakespeare/poetry/rapeoflucrece +2199 -0
  17. data/examples/dgrep/data/shakespeare/poetry/sonnets +2633 -0
  18. data/examples/dgrep/data/shakespeare/poetry/various +640 -0
  19. data/examples/dgrep/data/shakespeare/poetry/venusandadonis +1423 -0
  20. data/examples/dgrep/data/testfile1.txt +1 -0
  21. data/examples/dgrep/data/testfile2.txt +1 -0
  22. data/examples/dgrep/data/testfile3.txt +1 -0
  23. data/examples/dgrep/data/testfile4.txt +1 -0
  24. data/examples/dgrep/lib/dgrep.rb +59 -0
  25. data/examples/dgrep/lib/mapreduce_test.rb +32 -0
  26. data/examples/dgrep/lib/most_common_words.rb +45 -0
  27. data/examples/dgrep/script/dgrep +75 -0
  28. data/examples/rails_mysql_example/README +66 -0
  29. data/examples/rails_mysql_example/Rakefile +10 -0
  30. data/examples/rails_mysql_example/app/controllers/application.rb +10 -0
  31. data/examples/rails_mysql_example/app/helpers/application_helper.rb +3 -0
  32. data/examples/rails_mysql_example/app/models/user.rb +21 -0
  33. data/examples/rails_mysql_example/app/models/user_favorite.rb +5 -0
  34. data/examples/rails_mysql_example/app/models/user_mailer.rb +12 -0
  35. data/examples/rails_mysql_example/app/views/user_mailer/welcome.erb +5 -0
  36. data/examples/rails_mysql_example/config/boot.rb +109 -0
  37. data/examples/rails_mysql_example/config/database.yml +42 -0
  38. data/examples/rails_mysql_example/config/environment.rb +59 -0
  39. data/examples/rails_mysql_example/config/environments/development.rb +18 -0
  40. data/examples/rails_mysql_example/config/environments/production.rb +19 -0
  41. data/examples/rails_mysql_example/config/environments/test.rb +22 -0
  42. data/examples/rails_mysql_example/config/initializers/inflections.rb +10 -0
  43. data/examples/rails_mysql_example/config/initializers/mime_types.rb +5 -0
  44. data/examples/rails_mysql_example/config/initializers/skynet.rb +1 -0
  45. data/examples/rails_mysql_example/config/routes.rb +35 -0
  46. data/examples/rails_mysql_example/config/skynet_config.rb +36 -0
  47. data/examples/rails_mysql_example/db/migrate/001_create_skynet_tables.rb +43 -0
  48. data/examples/rails_mysql_example/db/migrate/002_create_users.rb +16 -0
  49. data/examples/rails_mysql_example/db/migrate/003_create_user_favorites.rb +14 -0
  50. data/examples/rails_mysql_example/db/schema.rb +85 -0
  51. data/examples/rails_mysql_example/db/skynet_mysql_schema.sql +33 -0
  52. data/examples/rails_mysql_example/doc/README_FOR_APP +2 -0
  53. data/examples/rails_mysql_example/lib/tasks/rails_mysql_example.rake +20 -0
  54. data/examples/rails_mysql_example/public/.htaccess +40 -0
  55. data/examples/rails_mysql_example/public/404.html +30 -0
  56. data/examples/rails_mysql_example/public/422.html +30 -0
  57. data/examples/rails_mysql_example/public/500.html +30 -0
  58. data/examples/rails_mysql_example/public/dispatch.cgi +10 -0
  59. data/examples/rails_mysql_example/public/dispatch.fcgi +24 -0
  60. data/examples/rails_mysql_example/public/dispatch.rb +10 -0
  61. data/{log/debug.log → examples/rails_mysql_example/public/favicon.ico} +0 -0
  62. data/examples/rails_mysql_example/public/images/rails.png +0 -0
  63. data/examples/rails_mysql_example/public/index.html +277 -0
  64. data/examples/rails_mysql_example/public/javascripts/application.js +2 -0
  65. data/examples/rails_mysql_example/public/javascripts/controls.js +963 -0
  66. data/examples/rails_mysql_example/public/javascripts/dragdrop.js +972 -0
  67. data/examples/rails_mysql_example/public/javascripts/effects.js +1120 -0
  68. data/examples/rails_mysql_example/public/javascripts/prototype.js +4225 -0
  69. data/examples/rails_mysql_example/public/robots.txt +5 -0
  70. data/examples/rails_mysql_example/script/about +3 -0
  71. data/examples/rails_mysql_example/script/console +3 -0
  72. data/examples/rails_mysql_example/script/destroy +3 -0
  73. data/examples/rails_mysql_example/script/generate +3 -0
  74. data/examples/rails_mysql_example/script/performance/benchmarker +3 -0
  75. data/examples/rails_mysql_example/script/performance/profiler +3 -0
  76. data/examples/rails_mysql_example/script/performance/request +3 -0
  77. data/examples/rails_mysql_example/script/plugin +3 -0
  78. data/examples/rails_mysql_example/script/process/inspector +3 -0
  79. data/examples/rails_mysql_example/script/process/reaper +3 -0
  80. data/examples/rails_mysql_example/script/process/spawner +3 -0
  81. data/examples/rails_mysql_example/script/runner +3 -0
  82. data/examples/rails_mysql_example/script/server +3 -0
  83. data/examples/rails_mysql_example/test/fixtures/user_favorites.yml +9 -0
  84. data/examples/rails_mysql_example/test/fixtures/users.yml +11 -0
  85. data/examples/rails_mysql_example/test/test_helper.rb +38 -0
  86. data/examples/rails_mysql_example/test/unit/user_favorite_test.rb +8 -0
  87. data/examples/rails_mysql_example/test/unit/user_test.rb +8 -0
  88. data/extras/README +7 -0
  89. data/extras/init.d/skynet +87 -0
  90. data/extras/nagios/check_skynet.sh +121 -0
  91. data/extras/rails/controllers/skynet_controller.rb +43 -0
  92. data/extras/rails/views/skynet/index.rhtml +137 -0
  93. data/lib/skynet.rb +59 -1
  94. data/lib/skynet/mapreduce_helper.rb +2 -2
  95. data/lib/skynet/mapreduce_test.rb +32 -1
  96. data/lib/skynet/message_queue_adapters/mysql.rb +422 -539
  97. data/lib/skynet/message_queue_adapters/tuple_space.rb +45 -71
  98. data/lib/skynet/skynet_active_record_extensions.rb +22 -11
  99. data/lib/skynet/skynet_config.rb +54 -20
  100. data/lib/skynet/skynet_console.rb +4 -1
  101. data/lib/skynet/skynet_console_helper.rb +5 -1
  102. data/lib/skynet/skynet_debugger.rb +58 -4
  103. data/lib/skynet/skynet_job.rb +61 -24
  104. data/lib/skynet/skynet_launcher.rb +29 -3
  105. data/lib/skynet/skynet_logger.rb +11 -1
  106. data/lib/skynet/skynet_manager.rb +403 -240
  107. data/lib/skynet/skynet_message.rb +1 -3
  108. data/lib/skynet/skynet_message_queue.rb +42 -19
  109. data/lib/skynet/skynet_partitioners.rb +19 -15
  110. data/lib/skynet/skynet_ruby_extensions.rb +18 -0
  111. data/lib/skynet/skynet_tuplespace_server.rb +17 -14
  112. data/lib/skynet/skynet_worker.rb +132 -98
  113. data/lib/skynet/version.rb +1 -1
  114. data/script/destroy +0 -0
  115. data/script/generate +0 -0
  116. data/script/txt2html +0 -0
  117. data/test/test_helper.rb +2 -0
  118. data/test/test_skynet.rb +13 -5
  119. data/test/test_skynet_manager.rb +24 -9
  120. data/test/test_skynet_task.rb +1 -1
  121. data/website/index.html +77 -29
  122. data/website/index.txt +53 -24
  123. data/website/stylesheets/screen.css +12 -12
  124. metadata +156 -66
  125. data/app_generators/skynet_install/templates/skynet +0 -46
  126. data/log/skynet.log +0 -29
  127. data/log/skynet_tuplespace_server.log +0 -7
  128. data/log/skynet_worker.pid +0 -1
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/about'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/console'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/destroy'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/profiler'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/request'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/plugin'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/inspector'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/reaper'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/spawner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/runner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/server'
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ one:
4
+ user_id: 1
5
+ favorite: MyString
6
+
7
+ two:
8
+ user_id: 1
9
+ favorite: MyString
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+ password: MyString
6
+ favorites: MyString
7
+
8
+ two:
9
+ name: MyString
10
+ password: MyString
11
+ favorites: MyString
@@ -0,0 +1,38 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
+ require 'test_help'
4
+
5
+ class Test::Unit::TestCase
6
+ # Transactional fixtures accelerate your tests by wrapping each test method
7
+ # in a transaction that's rolled back on completion. This ensures that the
8
+ # test database remains unchanged so your fixtures don't have to be reloaded
9
+ # between every test method. Fewer database queries means faster tests.
10
+ #
11
+ # Read Mike Clark's excellent walkthrough at
12
+ # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
13
+ #
14
+ # Every Active Record database supports transactions except MyISAM tables
15
+ # in MySQL. Turn off transactional fixtures in this case; however, if you
16
+ # don't care one way or the other, switching from MyISAM to InnoDB tables
17
+ # is recommended.
18
+ #
19
+ # The only drawback to using transactional fixtures is when you actually
20
+ # need to test transactions. Since your test is bracketed by a transaction,
21
+ # any transactions started in your code will be automatically rolled back.
22
+ self.use_transactional_fixtures = true
23
+
24
+ # Instantiated fixtures are slow, but give you @david where otherwise you
25
+ # would need people(:david). If you don't want to migrate your existing
26
+ # test cases which use the @david style and don't mind the speed hit (each
27
+ # instantiated fixtures translates to a database query per test method),
28
+ # then set this back to true.
29
+ self.use_instantiated_fixtures = false
30
+
31
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
32
+ #
33
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
34
+ # -- they do not yet inherit this setting
35
+ fixtures :all
36
+
37
+ # Add more helper methods to be used by all tests here...
38
+ end
@@ -0,0 +1,8 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class UserFavoriteTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ def test_truth
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class UserTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ def test_truth
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ I've included some extras to help you deploy and monitor skynet.
2
+
3
+ init.d/skynet # sample init.d script to start/stop/restart skynet
4
+
5
+ nagios/check_skynet.sh # A script we use to have nagios (a monitoring tool) check our skynet Q.
6
+
7
+ rails/* # I've included the controller and view we use to monitor our skynet Q
@@ -0,0 +1,87 @@
1
+ #!/bin/sh
2
+ #
3
+ # skynet start/stop skynet
4
+ #
5
+ # processname: solr
6
+ #
7
+
8
+ # Source function library
9
+ . /etc/init.d/functions
10
+
11
+ # Get network config
12
+ . /etc/sysconfig/network
13
+
14
+ HOME=/skynet/current
15
+ RAILS_ENV=production
16
+
17
+ cd $HOME
18
+ RETVAL=0
19
+ start() {
20
+ echo -n $"Starting Skynet: "
21
+ ./script/skynet &
22
+ RETVAL=$?
23
+ echo
24
+ return $RETVAL
25
+ }
26
+
27
+ stop() {
28
+ echo -n $"Stopping Skynet: "
29
+ pid=`cat /skynet/logs/skynet_production.pid`
30
+ kill ${pid}
31
+ RETVAL=$?
32
+ return $RETVAL
33
+ }
34
+
35
+ restart() {
36
+ echo -n $"Restarting Skynet: "
37
+ ./script/skynet -r
38
+ RETVAL=$?
39
+ echo
40
+ return $RETVAL
41
+ }
42
+
43
+
44
+ reload() {
45
+ stop
46
+ start
47
+ }
48
+
49
+ case "$1" in
50
+ start)
51
+ start
52
+ ;;
53
+ stop)
54
+ stop
55
+ ;;
56
+ status)
57
+ exit
58
+ ;;
59
+ restart)
60
+ restart
61
+ ;;
62
+ condrestart)
63
+ [ -f /var/lock/subsys/skynet ] && restart || :
64
+ ;;
65
+ reload)
66
+ reload
67
+ ;;
68
+ *)
69
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
70
+ exit 1
71
+ esac
72
+ get_pid_for_cmd ()
73
+ {
74
+ pid=`cat /skynet/logs/skynet_worker7647.pid`
75
+ return pid
76
+
77
+ #for pid in `ls -t /proc`; do
78
+ # if [ -d /proc/$pid ] && [ -f /proc/$pid/cmdline ]; then
79
+ # if [ "$1" = "$(</proc/$pid/cmdline)" ]; then
80
+ # return
81
+ # fi
82
+ # fi
83
+ #done
84
+ #pid=0
85
+ }
86
+
87
+ exit $?
@@ -0,0 +1,121 @@
1
+ #! /bin/sh
2
+ #
3
+ # Usage: ./check_skynet --help
4
+ #
5
+ # Examples:
6
+ # ./check_skynet -w 300 -c 2000 -u
7
+
8
+ # Paths to commands used in this script. These
9
+ # may have to be modified to match your system setup.
10
+
11
+ PATH=""
12
+
13
+ ECHO="/bin/echo"
14
+ SED="/bin/sed"
15
+ GREP="/bin/grep"
16
+ TAIL="/bin/tail"
17
+ CAT="/bin/cat"
18
+ CUT="/bin/cut"
19
+ WC="/bin/wc"
20
+ CURL="/usr/bin/curl -f"
21
+
22
+ PROGNAME=`/bin/basename $0`
23
+ PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'`
24
+ REVISION=`echo '$Revision: 0.1 $' | /bin/sed -e 's/[^0-9.]//g'`
25
+
26
+ . /usr/local/nagios/libexec/utils.sh
27
+
28
+ print_usage() {
29
+ echo "Usage: $PROGNAME -w <threshold> -c <threshold> -u <url of skynet status page>"
30
+ echo "Usage: $PROGNAME --help"
31
+ echo "Usage: $PROGNAME --version"
32
+ }
33
+
34
+ print_help() {
35
+ print_revision $PROGNAME $REVISION
36
+ echo ""
37
+ print_usage
38
+ echo ""
39
+ echo "Check Skynet's untaken_tasks"
40
+ echo ""
41
+ support
42
+ }
43
+
44
+ # Make sure the correct number of command line
45
+ # arguments have been supplied
46
+
47
+ if [ $# -lt 3 ]; then
48
+ print_usage
49
+ exit $STATE_UNKNOWN
50
+ fi
51
+
52
+ # Grab the command line arguments
53
+
54
+ exitstatus=$STATE_UNKNOWN #default
55
+ while test -n "$1"; do
56
+ case "$1" in
57
+ --help)
58
+ print_help
59
+ exit $STATE_OK
60
+ ;;
61
+ -h)
62
+ print_help
63
+ exit $STATE_OK
64
+ ;;
65
+ --version)
66
+ print_revision $PROGNAME $VERSION
67
+ exit $STATE_OK
68
+ ;;
69
+ -V)
70
+ print_revision $PROGNAME $VERSION
71
+ exit $STATE_OK
72
+ ;;
73
+ -w)
74
+ WARNING=$2;
75
+ shift;
76
+ ;;
77
+ -c)
78
+ CRITICAL=$2;
79
+ shift;
80
+ ;;
81
+ -u)
82
+ URL=$2;
83
+ shift;
84
+ ;;
85
+ *)
86
+ echo "Unknown argument: $1"
87
+ print_usage
88
+ exit $STATE_UNKNOWN
89
+ ;;
90
+ esac
91
+ shift
92
+ done
93
+
94
+
95
+ CURRENT=$($CURL $URL | $GREP "untaken_tasks\|down"| $CUT -d: -f2)
96
+
97
+ if [ -z $CURRENT ] ;then
98
+ $ECHO "CANNOT GATHER SKYNET TASKS CALL NOPS"
99
+ exit $STATE_UNKNOWN
100
+ fi
101
+
102
+ if [ $CURRENT -ge $CRITICAL ]; then
103
+ $ECHO "Skynet untaken_tasks: $CURRENT threshold: $CRITICAL CRITICAL"
104
+ $ECHO " "
105
+ exit $STATE_CRITICAL
106
+ fi
107
+
108
+ if [ $CURRENT -ge $WARNING ]; then
109
+ $ECHO "Skynet untaken_tasks: $CURRENT threshold: $WARNING WARNING"
110
+ $ECHO " "
111
+ exit $STATE_WARNING
112
+ fi
113
+
114
+ if [[ $CURRENT -lt $CRITICAL && $CURRENT -lt $WARNING ]]; then
115
+ $ECHO "Skynet untaken_tasks: $CURRENT threshold critical: $CRITICAL threshold warning: $WARNING OK"
116
+ $ECHO " "
117
+ exit $STATE_OK
118
+
119
+ fi
120
+ $ECHO "NO SCRIPT OUTPUT CALL NOPS!"
121
+ exit $STATE_CRITICAL
@@ -0,0 +1,43 @@
1
+ class Admin::SkynetController < AdminController
2
+
3
+ def index
4
+ begin
5
+ start_time = Time.now
6
+ setup
7
+ if params[:skynet_message_queue]
8
+ Skynet.configure(:MYSQL_MESSAGE_QUEUE_TABLE => params[:skynet_message_queue]) do
9
+ @stats = @mq.stats
10
+ end
11
+ else
12
+ @stats = @mq.stats
13
+ end
14
+ @stats.merge!(Skynet::Manager.stats_for_hosts)
15
+ @stats[:hosts] = @stats[:servers].size
16
+ @stats[:processed_time] = Time.now - start_time
17
+ rescue Exception => e
18
+ logger.error "ERROR #{e.inspect} #{e.backtrace.join("\n")}"
19
+ end
20
+ end
21
+
22
+ # plain text page that will be used by monitoring scripts
23
+ def status
24
+ begin
25
+ setup
26
+ stats = @mq.stats
27
+ stats[:servers] = stats[:servers].keys.join(",")
28
+ stats.each { |k,v| stats[k.to_s] = stats.delete(k) }
29
+ text = stats.keys.sort.collect{ |k| "#{k}:#{stats[k]}" }.join("\n") + "\n"
30
+ render :text => text, :content_type => 'text/plain'
31
+ rescue Exception => e
32
+ render :text => "skynet is down\n", :content_type => 'text/plain'
33
+ end
34
+ end
35
+
36
+ private
37
+
38
+ def setup
39
+ @mq ||= Skynet::MessageQueue.new(Skynet::CONFIG[:MESSAGE_QUEUE_ADAPTER])
40
+ @last_updated = Time.now.strftime('%r')
41
+ end
42
+
43
+ end
@@ -0,0 +1,137 @@
1
+
2
+ <div class="hd">
3
+ <h1>SKYNET STATUS</h1>
4
+ <span>Last updated: <%= @last_updated || 'N/A' %></span>
5
+ <br />
6
+ <br />
7
+ </div>
8
+
9
+ <% if @stats %>
10
+
11
+ <h2>Overall Stats</h2>
12
+ <table class="admin_table">
13
+ <thead>
14
+ <tr>
15
+ <th>Hosts</th>
16
+ <th>Workers</th>
17
+ <th>Active Workers<BR>(Masters / Tasks / Either)</th>
18
+ <th>Idle Workers<BR>(Masters / Tasks / Either)</th>
19
+ <th>Untaken Tasks<BR>(Master / Task) Future</th>
20
+ <th>Taken Tasks<BR>(Master / Task)</th>
21
+ <th>Results</th>
22
+ <th>Processed <br />(by active workers)</th>
23
+ <th>Process Time</th>
24
+ </tr>
25
+ </thead>
26
+ <tbody>
27
+ <tr>
28
+ <td class="numeric"><%= @stats[:hosts] %></td>
29
+ <td class="numeric"><%= @stats[:number_of_workers] %></td>
30
+ <td class="numeric"><b><%= @stats[:active_workers] %></b> (<%= @stats[:active_masters] %> / <%= @stats[:active_taskworkers] %> / <%= @stats[:active_master_or_task_workers] %>)</td>
31
+ <td class="numeric"><b><%= @stats[:idle_workers] %></b> (<%= @stats[:idle_masters] %> / <%= @stats[:idle_taskworkers] %> / <%= @stats[:idle_master_or_task_workers] %>)</td>
32
+ <td class="numeric"><%= @stats[:untaken_tasks] %> (<b><%= @stats[:untaken_master_tasks] %></b> / <%= @stats[:untaken_task_tasks] %>) <%= @stats[:untaken_future_tasks] %></td>
33
+ <td class="numeric"><b><%= @stats[:taken_tasks] %></b> (<%= @stats[:taken_master_tasks] %> / <%= @stats[:taken_task_tasks] %>)</td>
34
+ <td class="numeric"><%= @stats[:results] %></td>
35
+ <td class="numeric"><%= @stats[:processed] %> (<%= @stats[:processed_by_active_workers] %>)</td>
36
+ <td><%= @stats[:processed_time] %></td>
37
+ </tr>
38
+ </tbody>
39
+ </table>
40
+
41
+
42
+ <BR>
43
+ <h2>Servers</h2>
44
+ <table class="admin_table">
45
+ <colgroup>
46
+ <col span="1" width="3%" />
47
+ <col span="1" width="10%" />
48
+ <col span="1" width="5%" />
49
+ <col span="1" width="5%" />
50
+ <col span="1" width="5%" />
51
+ <col span="1" width="5%" />
52
+ </colgroup>
53
+ <thead>
54
+ <tr>
55
+ <th class="numeric">#</th>
56
+ <th>Hostname</th>
57
+ <th>Number of Workers</th>
58
+ <th>Active Workers<BR>Masters / Tasks / Either</th>
59
+ <th>Idle Workers<BR>Masters / Tasks / Either</th>
60
+ <th>Processed <br />(by active workers)</th>
61
+ </tr>
62
+ </thead>
63
+
64
+ <% if @stats[:servers] %>
65
+ <tbody>
66
+ <% @stats[:servers].keys.sort.each do |hostname| %>
67
+ <% server = @stats[:servers][hostname] %>
68
+ <% i = 1 %>
69
+ <tr>
70
+ <td class="numeric"><%= i %></td>
71
+ <td><%= server[:hostname] %></td>
72
+ <td class="numeric"><%= server[:number_of_workers] %></td>
73
+ <td class="numeric"><%= server[:active_workers] %> (<%= server[:active_masters] %> / <%= server[:active_taskworkers] %> / <%= server[:active_master_or_task_workers] %>) </td>
74
+ <td class="numeric"><%= server[:idle_workers] %> (<%= server[:idle_masters] %> / <%= server[:idle_taskworkers] %> / <%= server[:idle_master_or_task_workers] %>) </td>
75
+ <td class="numeric"><%= server[:processed] %> (<%= server[:processed_by_active_workers] %>)</td>
76
+ </tr>
77
+ <% i += 1 %>
78
+ <% end %>
79
+ </tbody>
80
+ <% end %>
81
+
82
+ </table>
83
+
84
+ <% end %>
85
+
86
+ <!-- <table class="admin_table">
87
+ <colgroup>
88
+ <col span="1" width="5%" />
89
+ <col span="1" width="8%" />
90
+ <col span="1" width="10%" />
91
+ <col span="1" width="10%" />
92
+ <col span="1" width="5%" />
93
+ <col span="1" width="5%" />
94
+ </colgroup>
95
+ <thead>
96
+ <tr>
97
+ <th class="numeric">#</th>
98
+ <th>Worker ID</th>
99
+ <th>Hostname</th>
100
+ <th>PID</th>
101
+ <th>Job ID</th>
102
+ <th>Task ID</th>
103
+ <th>Version</th>
104
+ <th>Processed</th>
105
+ <th>M/R</th>
106
+ <th>Name</th>
107
+ </tr>
108
+ </thead>
109
+
110
+ <% if false and @servers %>
111
+ <tbody>
112
+ <% @servers.each do |server| %>
113
+ <tr>
114
+ <td colspan="10"><%= server[:manager] %></td>
115
+ </tr>
116
+ <% i = 1 %>
117
+ <% server[:workers].each do |w| %>
118
+ <tr>
119
+ <td class="numeric"><%= i %></td>
120
+ <td><%= w.worker_id %></td>
121
+ <td><%= w.hostname %></td>
122
+ <td class="numeric"><%= w.process_id %></td>
123
+ <td class="numeric"><%= w.job_id %></td>
124
+ <td class="numeric"><%= w.task_id %></td>
125
+ <td class="numeric"><%= w.version %></td>
126
+ <td class="numeric"><%= w.processed %></td>
127
+ <td><%= w.map_or_reduce || '-' %></td>
128
+ <td><%= w.name %></td>
129
+ </tr>
130
+ <% i += 1 %>
131
+ <% end %>
132
+ <% end %>
133
+ </tbody>
134
+ <% end %>
135
+
136
+ </table> -->
137
+