wackamole 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +5 -1
- data/README.rdoc +12 -3
- data/bin/wackamole +2 -2
- data/data/fixtures.rb +132 -0
- data/features/env.rb +29 -0
- data/features/mission.feature +10 -0
- data/features/step_definitions/mission_steps.rb +5 -0
- data/lib/app.rb +23 -7
- data/lib/controllers/features.rb +3 -2
- data/lib/controllers/logs.rb +1 -0
- data/lib/controllers/mission.rb +14 -4
- data/lib/controllers/session.rb +32 -0
- data/lib/controllers/users.rb +3 -2
- data/lib/helpers/flash_helper.rb +4 -1
- data/lib/helpers/logs_helper.rb +2 -1
- data/lib/helpers/session_helper.rb +29 -0
- data/lib/wackamole.rb +1 -1
- data/lib/wackamole/models/control.rb +15 -1
- data/lib/wackamole/models/feature.rb +11 -2
- data/lib/wackamole/models/log.rb +1 -0
- data/lib/wackamole/models/mission.rb +9 -7
- data/lib/wackamole/models/mole_info.rb +8 -4
- data/lib/wackamole/models/search_filter.rb +48 -15
- data/lib/wackamole/models/user.rb +12 -1
- data/public/stylesheets/wackamole.css +60 -3
- data/spec/config/bogus_test.yml +1 -1
- data/spec/config/test.yml +1 -1
- data/spec/spec_helper.rb +3 -0
- data/spec/ui/log_spec.rb +68 -0
- data/spec/ui/mission_spec.rb +64 -0
- data/spec/ui/session_spec.rb +39 -0
- data/spec/ui_utils/mission_util.rb +41 -0
- data/spec/{models → wackamole/models}/control_spec.rb +21 -21
- data/spec/{models → wackamole/models}/feature_spec.rb +7 -7
- data/spec/{models → wackamole/models}/log_spec.rb +5 -5
- data/spec/{models → wackamole/models}/mission_spec.rb +11 -7
- data/spec/wackamole/models/moled_info_spec.rb +36 -0
- data/spec/{models → wackamole/models}/search_filter_spec.rb +12 -16
- data/spec/{models → wackamole/models}/user_spec.rb +5 -5
- data/spec/{wackamole_spec.rb → wackamole/wackamole_spec.rb} +2 -2
- data/tasks/fixtures.rake +3 -1
- data/tasks/setup.rb +2 -1
- data/tasks/spec.rake +17 -3
- data/views/dashboard/_report.erb +3 -3
- data/views/layout.erb +44 -11
- data/views/logs/show.erb +3 -0
- data/views/mission/_report.erb +2 -2
- data/views/session/login.erb +28 -0
- data/views/shared/_search.erb +1 -1
- data/views/users/index.js.erb +1 -1
- metadata +22 -10
- data/spec/models/moled_info_spec.rb +0 -30
data/tasks/spec.rake
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
|
2
2
|
require 'spec/rake/verify_rcov'
|
3
|
-
require '
|
3
|
+
require 'data/fixtures'
|
4
4
|
|
5
5
|
namespace :spec do
|
6
|
-
|
6
|
+
|
7
7
|
desc 'Run all specs with basic output'
|
8
8
|
Spec::Rake::SpecTask.new(:run) do |t|
|
9
9
|
t.ruby_opts = PROJ.ruby_opts
|
@@ -12,6 +12,13 @@ namespace :spec do
|
|
12
12
|
t.libs += PROJ.libs
|
13
13
|
end
|
14
14
|
|
15
|
+
Spec::Rake::SpecTask.new(:run_ui) do |t|
|
16
|
+
t.ruby_opts = PROJ.ruby_opts
|
17
|
+
t.spec_opts = PROJ.spec.opts
|
18
|
+
t.spec_files = PROJ.spec.ui_files
|
19
|
+
t.libs += PROJ.libs
|
20
|
+
end
|
21
|
+
|
15
22
|
desc 'Run all specs with text output'
|
16
23
|
Spec::Rake::SpecTask.new(:specdoc) do |t|
|
17
24
|
t.ruby_opts = PROJ.ruby_opts
|
@@ -30,6 +37,7 @@ namespace :spec do
|
|
30
37
|
t.rcov = true
|
31
38
|
t.rcov_dir = PROJ.rcov.dir
|
32
39
|
t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
|
40
|
+
# t.rcov_opts = t.rcov_opts + ['--include', 'lib/helpers/*.rb']
|
33
41
|
end
|
34
42
|
|
35
43
|
RCov::VerifyTask.new(:verify) do |t|
|
@@ -45,7 +53,13 @@ namespace :spec do
|
|
45
53
|
end # namespace :spec
|
46
54
|
|
47
55
|
desc 'Alias to spec:run'
|
48
|
-
task :spec
|
56
|
+
task :spec => 'spec:run'
|
57
|
+
|
58
|
+
desc 'Alias to ui run'
|
59
|
+
task :ui => 'spec:run_ui'
|
60
|
+
|
61
|
+
# desc 'Alias to fixtures'
|
62
|
+
# task :fixtures => 'spec:fixtures'
|
49
63
|
|
50
64
|
task :clobber => 'spec:clobber_rcov' if HAVE_RCOV
|
51
65
|
|
data/views/dashboard/_report.erb
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
<p class="status">Performance</p>
|
13
13
|
<p class="result">
|
14
14
|
<% if @info[:perf_load] > 0 %>
|
15
|
-
<%= link_to pluralize( @info[:perf_load], 'issue' ), "/dashboard/logs/#{Rackamole.perf}/", :class => "site_link" %>
|
15
|
+
<%= link_to pluralize( @info[:perf_load], 'issue' ), "/dashboard/logs/#{Rackamole.perf}/#{@updated_on.hour}/", :class => "site_link" %>
|
16
16
|
<% else %>
|
17
17
|
<%=pluralize( @info[:perf_load], 'issue' )%>
|
18
18
|
<% end %>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
<p class="status">Uncaught Exceptions</p>
|
23
23
|
<p class="result">
|
24
24
|
<% if @info[:fault_load] > 0 %>
|
25
|
-
<%= link_to pluralize( @info[:fault_load], 'issue' ), "/dashboard/logs/#{Rackamole.fault}/", :class => "site_link" %>
|
25
|
+
<%= link_to pluralize( @info[:fault_load], 'issue' ), "/dashboard/logs/#{Rackamole.fault}/#{@updated_on.hour}/", :class => "site_link" %>
|
26
26
|
<% else %>
|
27
27
|
<%=pluralize( @info[:fault_load], 'issue' )%>
|
28
28
|
<% end %>
|
@@ -59,7 +59,7 @@
|
|
59
59
|
<% end %>
|
60
60
|
</li>
|
61
61
|
<li>
|
62
|
-
<p id="features">
|
62
|
+
<p id="features">Features</p>
|
63
63
|
<% unless zeroed_series?( @info[:feature_series] ) %>
|
64
64
|
<div class="heat" id="svg_features"></div>
|
65
65
|
<% else %>
|
data/views/layout.erb
CHANGED
@@ -9,25 +9,47 @@
|
|
9
9
|
<%= javascripts %w[jquery_min jquery_ui_min] %>
|
10
10
|
</head>
|
11
11
|
|
12
|
+
<style>
|
13
|
+
span#version {
|
14
|
+
position: relative;
|
15
|
+
top: -12px;
|
16
|
+
left: 32px;
|
17
|
+
font-weight: bold;
|
18
|
+
color: #316071;
|
19
|
+
}
|
20
|
+
a.logout {
|
21
|
+
font-size: 0.8em;
|
22
|
+
}
|
23
|
+
</style>
|
12
24
|
<body id="body">
|
13
25
|
<div id="overall">
|
14
|
-
<div id="logo"
|
15
|
-
|
26
|
+
<div id="logo">
|
27
|
+
<span id="version"><%=Wackamole.version%></span>
|
28
|
+
<%= link_to image_tag( 'wackamole_logo.png', :border => 0 ), '/mission' %>
|
16
29
|
</div>
|
17
|
-
<div id="app_info">
|
30
|
+
<div id="app_info">
|
31
|
+
<% if console_auth? and !root_path? %>
|
32
|
+
<%= link_to "log out", "/session/delete", :class => "site_link logout" %>
|
33
|
+
<% end %>
|
34
|
+
|
18
35
|
<% if @app_info %>
|
19
36
|
<ul>
|
20
37
|
<li>«<span><%=@app_info[:app_name]%></span>»</li>
|
21
38
|
<li id="env"><%=@app_info[:stage]%></li>
|
22
39
|
<ul>
|
23
40
|
<% end %>
|
24
|
-
|
41
|
+
<% unless root_path? %>
|
42
|
+
<p><span id="timestamp"><%=partial :'shared/timestamp'%></span></p>
|
43
|
+
<% end %>
|
25
44
|
</div>
|
26
|
-
<div id="main">
|
45
|
+
<div id="main">
|
27
46
|
<div class="flash"></div>
|
28
|
-
|
47
|
+
|
48
|
+
<% if @app_info %>
|
29
49
|
<div id='navigation' class='corners'>
|
30
|
-
|
50
|
+
<% unless Wackamole::Control.single_app? %>
|
51
|
+
<%=link_to "mission control", "/mission", :class => "site_link land" %> •
|
52
|
+
<% end %>
|
31
53
|
<%=link_to "dashboard" , "/dashboard/#{@app_info[:app_name]}/#{@app_info[:stage]}", :class => "site_link dash" %> •
|
32
54
|
<%=link_to "logs" , "/logs/1" , :class => "site_link logs" %> •
|
33
55
|
<%=link_to "features" , "/features/1" , :class => "site_link features" %> •
|
@@ -38,10 +60,21 @@
|
|
38
60
|
<%= yield %>
|
39
61
|
</div>
|
40
62
|
|
41
|
-
|
42
|
-
|
43
|
-
|
63
|
+
<% unless root_path? %>
|
64
|
+
<div id="footer" style="text-align:right">
|
65
|
+
<%= link_to image_tag( 'powered_by.png', :border => 0 ), "http://www.rackamole.com", :target => "#" %>
|
66
|
+
</div>
|
67
|
+
<% end %>
|
44
68
|
|
45
69
|
</div>
|
46
70
|
</body>
|
47
|
-
</html>
|
71
|
+
</html>
|
72
|
+
|
73
|
+
<script>
|
74
|
+
$( function() {
|
75
|
+
// console.log( "Flash " + $('div.flash').html().length + " == " + $('div.flash').html() + '==' );
|
76
|
+
|
77
|
+
if ( $('div.flash') && $('div.flash').html() && $('div.flash').html().length > 1 )
|
78
|
+
$('div.flash').fadeOut( 2000 );
|
79
|
+
});
|
80
|
+
</script>
|
data/views/logs/show.erb
CHANGED
data/views/mission/_report.erb
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
<tbody>
|
20
20
|
<% applications.each_pair do |app_name, envs| %>
|
21
21
|
<% envs.each do |env| %>
|
22
|
-
<tr class="
|
22
|
+
<tr class="app_info" id="<%=app_name%>_<%=env%>">
|
23
23
|
<td valign="top"><%= link_to app_name, "/dashboard/#{app_name}/#{env}", :class => 'site_link' %></td>
|
24
24
|
<td valign="top"><%= env %></td>
|
25
25
|
<% %w(to_date today last_tick).each do |period| %>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<% clazz = ( (count > 0 and %w(last_tick today).include?(period)) ? assign_class( type, count ) : nil) %>
|
33
33
|
<td width="25px">
|
34
34
|
<% if( %w(last_tick today).include?( period ) and count > 0 ) %>
|
35
|
-
<%= link_to Wackamole::Mission.to_type_name(type), "/mission/logs/#{app_name}/#{env}/#{type}", :class => "site_link" %>:
|
35
|
+
<%= link_to Wackamole::Mission.to_type_name(type), "/mission/logs/#{app_name}/#{env}/#{type}", :class => "site_link", :id => "#{app_name}_#{env}_#{type}" %>:
|
36
36
|
<% else %>
|
37
37
|
<%=Wackamole::Mission.to_type_name(type)%>:
|
38
38
|
<% end %>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<center>
|
2
|
+
<div id="dialog">
|
3
|
+
<div id="inner_box" style="clear:both">
|
4
|
+
<form id="login" action="/session/create" method="post">
|
5
|
+
<div>
|
6
|
+
<label for="username">Login</label>
|
7
|
+
<input id="username" type="text" name="login[username]"-%>
|
8
|
+
</div>
|
9
|
+
<div>
|
10
|
+
<label for="password">Password</label>
|
11
|
+
<input id="password" type="password" name="login[password]"-%>
|
12
|
+
</div>
|
13
|
+
<div>
|
14
|
+
<input type="submit" name="commit" value="Log In"/>
|
15
|
+
</div>
|
16
|
+
</form>
|
17
|
+
<% if session[:flash] and session[:flash][:error] %>
|
18
|
+
<div class="flash_error corners">
|
19
|
+
<%= session[:flash][:error] %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<div id="copyright">
|
25
|
+
© 2010 liquidrail, llc.
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</center>
|
data/views/shared/_search.erb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<div id="search">
|
2
2
|
<form id="search_form">
|
3
|
-
<input id="search_term" class="search" type="text" size="50" name="search_filter[search_terms]"/>
|
3
|
+
<input id="search_term" class="search" type="text" size="50" name="search_filter[search_terms]" value="<%=@filter.search_terms%>"/>
|
4
4
|
<%= image_tag 'loading.gif', :border => 0, :size => "20x20", :id => "search_loader" %>
|
5
5
|
<input type="submit" value="Search" style="display: none;" name="commit"/>
|
6
6
|
</form>
|
data/views/users/index.js.erb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
$('#users').html( '<%= escape_javascript( partial( :'users/
|
1
|
+
$('#users').html( '<%= escape_javascript( partial( :'users/rows' ) ) %>')
|
2
2
|
$('p#timestamp').html( "<%=escape_javascript(partial(:'shared/timestamp'))%>" );
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wackamole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernand Galiana
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-28 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -138,6 +138,7 @@ extra_rdoc_files:
|
|
138
138
|
- views/mission/_report.erb
|
139
139
|
- views/mission/index.erb
|
140
140
|
- views/mission/refresh_js.erb
|
141
|
+
- views/session/login.erb
|
141
142
|
- views/shared/_filter.erb
|
142
143
|
- views/shared/_flash.erb
|
143
144
|
- views/shared/_search.erb
|
@@ -157,11 +158,16 @@ files:
|
|
157
158
|
- bin/setup_indexes
|
158
159
|
- bin/wackamole
|
159
160
|
- config.ru
|
161
|
+
- data/fixtures.rb
|
162
|
+
- features/env.rb
|
163
|
+
- features/mission.feature
|
164
|
+
- features/step_definitions/mission_steps.rb
|
160
165
|
- lib/app.rb
|
161
166
|
- lib/controllers/dashboard.rb
|
162
167
|
- lib/controllers/features.rb
|
163
168
|
- lib/controllers/logs.rb
|
164
169
|
- lib/controllers/mission.rb
|
170
|
+
- lib/controllers/session.rb
|
165
171
|
- lib/controllers/users.rb
|
166
172
|
- lib/helpers/dashboard_helper.rb
|
167
173
|
- lib/helpers/features_helper.rb
|
@@ -170,6 +176,7 @@ files:
|
|
170
176
|
- lib/helpers/main_helper.rb
|
171
177
|
- lib/helpers/mission_helper.rb
|
172
178
|
- lib/helpers/rails_helper.rb
|
179
|
+
- lib/helpers/session_helper.rb
|
173
180
|
- lib/wackamole.rb
|
174
181
|
- lib/wackamole/core_ext/date_time.rb
|
175
182
|
- lib/wackamole/core_ext/time.rb
|
@@ -275,15 +282,19 @@ files:
|
|
275
282
|
- spec/core_ext/date_time_spec.rb
|
276
283
|
- spec/core_ext/time_spec.rb
|
277
284
|
- spec/data/fixtures.rb
|
278
|
-
- spec/models/control_spec.rb
|
279
|
-
- spec/models/feature_spec.rb
|
280
|
-
- spec/models/log_spec.rb
|
281
|
-
- spec/models/mission_spec.rb
|
282
|
-
- spec/models/moled_info_spec.rb
|
283
|
-
- spec/models/search_filter_spec.rb
|
284
|
-
- spec/models/user_spec.rb
|
285
285
|
- spec/spec_helper.rb
|
286
|
-
- spec/
|
286
|
+
- spec/ui/log_spec.rb
|
287
|
+
- spec/ui/mission_spec.rb
|
288
|
+
- spec/ui/session_spec.rb
|
289
|
+
- spec/ui_utils/mission_util.rb
|
290
|
+
- spec/wackamole/models/control_spec.rb
|
291
|
+
- spec/wackamole/models/feature_spec.rb
|
292
|
+
- spec/wackamole/models/log_spec.rb
|
293
|
+
- spec/wackamole/models/mission_spec.rb
|
294
|
+
- spec/wackamole/models/moled_info_spec.rb
|
295
|
+
- spec/wackamole/models/search_filter_spec.rb
|
296
|
+
- spec/wackamole/models/user_spec.rb
|
297
|
+
- spec/wackamole/wackamole_spec.rb
|
287
298
|
- tasks/bones.rake
|
288
299
|
- tasks/fixtures.rake
|
289
300
|
- tasks/gem.rake
|
@@ -314,6 +325,7 @@ files:
|
|
314
325
|
- views/mission/index.erb
|
315
326
|
- views/mission/refresh_js.erb
|
316
327
|
- views/mission/trash.txt
|
328
|
+
- views/session/login.erb
|
317
329
|
- views/shared/_filter.erb
|
318
330
|
- views/shared/_flash.erb
|
319
331
|
- views/shared/_search.erb
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), %w[.. spec_helper])
|
2
|
-
require 'chronic'
|
3
|
-
|
4
|
-
describe Wackamole::MoledInfo do
|
5
|
-
before( :all ) do
|
6
|
-
Wackamole::Control.init_config( File.join(File.dirname(__FILE__), %w[.. config test.yml]), 'test' )
|
7
|
-
Wackamole::Control.connection.should_not be_nil
|
8
|
-
Wackamole::Control.db( "mole_fred_test_mdb" )
|
9
|
-
@test_time = Chronic.parse( "2010/01/01 01:00:00" )
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should gather dashboard info correctly" do
|
13
|
-
info = Wackamole::MoledInfo.collect_dashboard_info( @test_time )
|
14
|
-
|
15
|
-
info[:total_users].should == 10
|
16
|
-
info[:user_load].should == 2
|
17
|
-
info[:total_features].should == 10
|
18
|
-
info[:feature_load].should == 2
|
19
|
-
info[:fault_load].should == 2
|
20
|
-
info[:perf_load].should == 2
|
21
|
-
|
22
|
-
series = 24.times.collect { |i| 0 }
|
23
|
-
series[0] = 5
|
24
|
-
series[1] = 2
|
25
|
-
info[:user_series].should == series
|
26
|
-
info[:feature_series].should == series
|
27
|
-
info[:fault_series].should == series
|
28
|
-
info[:perf_series].should == series
|
29
|
-
end
|
30
|
-
end
|