wackamole 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,8 @@
1
- == 1.0.0 / 2010-01-09
1
+ == 0.0.1 / 2010-01-09
2
2
 
3
- * 1 major enhancement
4
- * Birthday!
3
+ * 1 Initial drop. Made wackamole a gem
4
+
5
+ == 0.0.2 / 2010-01-28
6
+
7
+ * 1 Bug fixes and some cleanup
8
+ * 2 Updated details info on logs from Rackamole user_agent parsing
@@ -3,29 +3,25 @@
3
3
 
4
4
  == DESCRIPTION:
5
5
 
6
- This is a companion sinatra app for the Rackamole framework which provides for recording
7
- interactions with your rack applications. Wackamole allows you to view, filter and drilldown
8
- on the collected moled information, hence allowing you to observe your
9
- applications live in the wild...
6
+ This is a companion sinatra app for the Rackamole framework which provides for recording
7
+ interactions with your rack applications. Wackamole allows you to view, filter and drilldown
8
+ on the collected moled information, hence allowing you to observe your
9
+ applications live in the wild...
10
10
 
11
11
  == PROJECT INFORMATION
12
12
 
13
- * Developer: Fernand Galiana
14
- * Site: http://www.rackamole.com
15
- * Twitter: http://twitter.com/rackamole
16
- * Forum: http://groups.google.com/group/rackamole
17
- * Git: git://github.com/derailed/wackamole.git
13
+ Developer: Fernand Galiana
14
+ Site: http://www.rackamole.com
15
+ Twitter: http://twitter.com/rackamole
16
+ Forum: http://groups.google.com/group/rackamole
17
+ Git: git://github.com/derailed/wackamole.git
18
18
 
19
19
  == FEATURES
20
20
 
21
- * Self bundled sinatra app
22
- * View daily activity
23
- * Search and filter on any info collected by the mole
24
- * Reports performance and exceptions that might occur in your applications
25
-
26
- == ROAD MAP
27
-
28
- Rewrite as sinatra gem - done
21
+ o Self bundled sinatra app ( NEW !)
22
+ o View daily activity
23
+ o Search and filter on any info collected by the mole
24
+ o Reports performance and exceptions that might occur in your applications
29
25
 
30
26
  == DEPENDENCIES
31
27
 
@@ -68,8 +64,28 @@ applications live in the wild...
68
64
 
69
65
  Watch your creation live!
70
66
 
67
+ NOTE: By default wackamole uses mongo_rack for storing its session information.
68
+ This assumes that you have a local mongoDB instance running on the default port 27017.
69
+
70
+ > wackamole
71
+
72
+ Alternatively you can use a different mongo instance to store wackamole session information
73
+ or use memcache by specifying the --pool options as follows:
74
+
75
+ To use the mongo session store on localhost at port 27030 with db name 'wackamole' and collection named 'sessions'
76
+
77
+ > wackamole --pool "mongo://localhost:27030/wackamole/sessions"
78
+
79
+ To use memcache session store on localhost at port 11233 with namespace 'wackamole'
80
+
81
+ > wackamole --pool "memcache://localhost:11233/wackamole"
82
+
83
+ The pool options assumes the following format:
84
+
85
+ --pool {mongo|memcache}://{host}:{port}/{db_name|namespace}/{cltn_name}
86
+
71
87
  Please checkout the forum and send us feedback and issues. This is still work in progress so your
72
- feedback will be very much appreciated!
88
+ feedback is very important and will be very much appreciated!
73
89
 
74
90
  == LICENSE:
75
91
 
data/lib/app.rb CHANGED
@@ -55,9 +55,15 @@ before do
55
55
  session[:filter] = @filter
56
56
  end
57
57
  @updated_on = Time.now
58
- @refresh_rate = 15
58
+ @refresh_rate = 60
59
59
 
60
60
  @app_info = session[:app_info]
61
- Wackamole::Control.switch_mole_db!( @app_info[:app_name].downcase, @app_info[:stage] ) if @app_info
61
+ begin
62
+ Wackamole::Control.switch_mole_db!( @app_info[:app_name].downcase, @app_info[:stage] ) if @app_info
63
+ rescue => boom
64
+ puts boom
65
+ @app_info = nil
66
+ session[:app_info] = nil
67
+ end
62
68
  end
63
69
  end
@@ -6,16 +6,16 @@ module LogsHelper
6
6
  user = Wackamole::User.users_cltn.find_one( user_id )
7
7
  user['una']
8
8
  end
9
-
9
+
10
10
  # ---------------------------------------------------------------------------
11
- def feature_name_for( feature_id )
11
+ # Find feature context for log entry
12
+ def context_for( feature_id )
12
13
  feature = Wackamole::Feature.features_cltn.find_one( feature_id )
13
- if feature['ctx']
14
- return feature['ctx']
15
- end
16
- "#{feature['ctrl']}##{feature['act']}"
14
+ return "Unknown" unless feature
15
+ return "#{feature['ctl']}##{feature['act']}" if feature['ctl']
16
+ feature['ctx']
17
17
  end
18
-
18
+
19
19
  # ---------------------------------------------------------------------------
20
20
  def human_type( type )
21
21
  case type
@@ -41,16 +41,6 @@ module LogsHelper
41
41
  end
42
42
  "N/A"
43
43
  end
44
-
45
- # ---------------------------------------------------------------------------
46
- # Find feature context for log entry
47
- def context_for( feature_id )
48
- feature = Wackamole::Feature.features_cltn.find_one( feature_id )
49
- if feature['ctl']
50
- return "#{feature['ctl']}##{feature['act']}"
51
- end
52
- feature['ctx']
53
- end
54
44
 
55
45
  # ---------------------------------------------------------------------------
56
46
  # Converts mole type to big icon
@@ -4,11 +4,10 @@ module MissionHelper
4
4
  # -------------------------------------------------------------------------
5
5
  def load_report
6
6
  @old_reports = Wackamole::Mission.find( {}, :sort => [ [:app, Mongo::ASCENDING], [:env, Mongo::ASCENDING] ] ).to_a
7
-
8
7
  last_tick = session[:last_tick]
9
8
  reset = last_tick.nil?
10
9
  last_tick = last_tick || Chronic.parse( '1 minute ago' )
11
- session[:last_tick] = Time.now
10
+ session[:last_tick] = Time.now
12
11
  @reports = Wackamole::Mission.rollups( last_tick.utc, reset )
13
12
  end
14
13
 
@@ -1,7 +1,7 @@
1
1
  module Wackamole
2
2
 
3
3
  # :stopdoc:
4
- VERSION = '0.0.1' unless defined? Wackamole::VERSION
4
+ VERSION = '0.0.2' unless defined? Wackamole::VERSION
5
5
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR unless defined? Wackamole::LIBPATH
6
6
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR unless defined? Wackamole::PATH
7
7
  # :startdoc:
@@ -114,8 +114,7 @@ module Wackamole
114
114
 
115
115
  # -----------------------------------------------------------------------
116
116
  # Fetch database instance
117
- def self.db( db_name=nil, opts={:strict => true} )
118
- # puts "#{db_name} -- #{@db.inspect}"
117
+ def self.db( db_name=nil, opts={:strict => true} )
119
118
  return @db if @db and !db_name
120
119
  return @db if @db and @db.name == db_name
121
120
  raise "No database specified" unless db_name
@@ -150,7 +150,7 @@ module Wackamole
150
150
  }
151
151
  end
152
152
 
153
- logs = db['logs'].find( conds, :fields => ['typ', 'rti', 'fault', 'fid'] )
153
+ logs = db['logs'].find( conds, :fields => ['typ', 'rti', 'fault', 'fid'] )
154
154
  totals =
155
155
  {
156
156
  Rackamole.feature => 0,
@@ -42,8 +42,8 @@ module Wackamole
42
42
  # ---------------------------------------------------------------------------
43
43
  # Find all features
44
44
  def features
45
- features = Feature.features_cltn.find().to_a
46
- features = features.map { |f| [context_for(f), f['_id']] }
45
+ rows = Feature.features_cltn.find().to_a
46
+ features = rows.map { |f| [context_for(f), f['_id']] }
47
47
  features.sort! { |a,b| a.first <=> b.first }
48
48
  features.insert( 0, ["All", -1] )
49
49
  end
Binary file
@@ -20,7 +20,7 @@ PROJ = OpenStruct.new(
20
20
  :email => nil,
21
21
  :url => "\000",
22
22
  :version => ENV['VERSION'] || '0.0.0',
23
- :exclude => %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ ^pkg/),
23
+ :exclude => %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ ^pkg/ ^exps/),
24
24
  :release_name => ENV['RELEASE'],
25
25
 
26
26
  # System Defaults
@@ -4,10 +4,10 @@
4
4
  <th width="80%">Value</th>
5
5
  </thead>
6
6
  <tbody>
7
- <% hash.each_pair do |k,v| %>
7
+ <% hash.keys.sort.each do |k| %>
8
8
  <tr>
9
9
  <td class="label"><%=k%></td>
10
- <td><%=v%></td>
10
+ <td><%=hash[k]%></td>
11
11
  </tr>
12
12
  <% end %>
13
13
  </tbody>
@@ -24,7 +24,7 @@
24
24
  <td><%=format_host( log['hos'] )%></td>
25
25
  <td><%=timestamp_for log %></td>
26
26
  <td align="right"><%=request_time( log['rti'] )%></td>
27
- <td align="right"><%=browser_icon( log['bro'] )%></td>
27
+ <td align="right"><%=browser_icon( log['bro']['name'] )%></td>
28
28
  </tr>
29
29
  <% count+=1;end %>
30
30
  </body>
@@ -4,7 +4,7 @@
4
4
  <%=human_type @log['typ'] %>
5
5
  </p>
6
6
  <p class="title" id="feature">
7
- <%=feature_name_for @log['fid'] %>
7
+ <%=context_for @log['fid'] %>
8
8
  </p>
9
9
  </p>
10
10
 
@@ -35,10 +35,26 @@
35
35
  <td><%="%4.2f secs" % @log['rti']%></td>
36
36
  </tr>
37
37
  <% end %>
38
+ <tr>
39
+ <td class="label">Status</td>
40
+ <td><%=@log['sts']%></td>
41
+ </tr>
38
42
  <tr>
39
43
  <td class="label">Software</td>
40
44
  <td><%=@log['sof']%></td>
41
45
  </tr>
46
+ <% if @log['mac'] %>
47
+ <tr>
48
+ <td class="label" valign="top">Machine</td>
49
+ <td><%=partial :'logs/hash', :object => @log['mac']%></td>
50
+ </tr>
51
+ <% end %>
52
+ <% if @log['bro'] and @log['bro'].is_a?( Hash ) %>
53
+ <tr>
54
+ <td class="label" valign="top">Browser</td>
55
+ <td><%=partial :'logs/hash', :object => @log['bro']%></td>
56
+ </tr>
57
+ <% end %>
42
58
  <% if @log['msg'] %>
43
59
  <tr>
44
60
  <td class="label" valign="top">Error</td>
@@ -49,6 +65,12 @@
49
65
  <td><%=partial :'logs/array', :object => @log['sta']%></td>
50
66
  </tr>
51
67
  <% end %>
68
+ <% if @log['hdr'] %>
69
+ <tr>
70
+ <td class="label" valign="top">Headers</td>
71
+ <td><%=partial :'logs/hash', :object => @log['hdr']%></td>
72
+ </tr>
73
+ <% end %>
52
74
  <% if @log['par'] %>
53
75
  <tr>
54
76
  <td class="label" valign="top">Parameters</td>
@@ -1,6 +1,6 @@
1
1
  <% if @reports.count == 0 %>
2
2
  <div class="doh">
3
- <p>Unable to find a Rackamole MongoDb database on this connection.</p>
3
+ <p>Unable to find a Rackamole MongoDb database on this connection <%=Wackamole::Control.connection.host%>:<%=Wackamole::Control.connection.port%>.</p>
4
4
  <p>Make sure you moled database follows this naming convention</p>
5
5
  <p>mole_{<i>application name in lower case</i>}_{<i>environment</i>}_mdb</p>
6
6
  </div>
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.1
4
+ version: 0.0.2
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-01-20 00:00:00 -07:00
12
+ date: 2010-01-31 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -102,11 +102,7 @@ dependencies:
102
102
  - !ruby/object:Gem::Version
103
103
  version: 2.5.1
104
104
  version:
105
- description: |-
106
- This is a companion sinatra app for the Rackamole framework which provides for recording
107
- interactions with your rack applications. Wackamole allows you to view, filter and drilldown
108
- on the collected moled information, hence allowing you to observe your
109
- applications live in the wild...
105
+ description: " This is a companion sinatra app for the Rackamole framework which provides for recording\n interactions with your rack applications. Wackamole allows you to view, filter and drilldown \n on the collected moled information, hence allowing you to observe your\n applications live in the wild..."
110
106
  email: fernand.galiana@gmail.com
111
107
  executables:
112
108
  - wackamole
@@ -147,8 +143,6 @@ files:
147
143
  - History.txt
148
144
  - README.rdoc
149
145
  - Rakefile
150
- - aa.rb
151
- - aaa.txt
152
146
  - bin/wackamole
153
147
  - lib/app.rb
154
148
  - lib/controllers/dashboard.rb
@@ -218,6 +212,8 @@ files:
218
212
  - public/images/info_big.psd
219
213
  - public/images/info_small.png
220
214
  - public/images/info_small.psd
215
+ - public/images/leaf.gif
216
+ - public/images/leaf.psd
221
217
  - public/images/loading.gif
222
218
  - public/images/loading1.gif
223
219
  - public/images/mole_error.png
data/aa.rb DELETED
@@ -1,25 +0,0 @@
1
- require 'rubygems'
2
- require 'mongo'
3
-
4
- puts BSON.serialize( {:a => [10, 20, 30]}, true ).inspect
5
-
6
- class Fred
7
- attr_accessor :a, :b
8
-
9
- def initialize( a, b )
10
- @a = a
11
- @b = b
12
- end
13
-
14
- def to_bson
15
- puts "YO"
16
- end
17
-
18
- def serialize
19
- puts "Hello"
20
- end
21
- end
22
-
23
- f = Fred.new( 10, 20 )
24
-
25
- BSON.serialize( { :blee => f }, true )
data/aaa.txt DELETED
@@ -1,13 +0,0 @@
1
- <form id="filter_form"
2
- style="text-align: left; height: 30px; float: left; width: 75%;"
3
- onsubmit="
4
- jQuery.ajax({beforeSend:function(request){$('#loading' ).show();},
5
- complete:function(request){$('#loading' ).hide();},
6
- data:jQuery.param(jQuery(this).serializeArray()) + '
7
- &authenticity_token=' +
8
- encodeURIComponent('h++MWbNXSamQ44OE0+9e9gvC2VUyH5yoeKt4m60N1/g='),
9
- dataType:'script',
10
- type:'post',
11
- url:'/logs/filter'}); return false;"
12
- method="post"
13
- action="/logs/filter">