fiveruns-dash-merb 0.6.1 → 0.6.2

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/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 1
2
+ :patch: 2
3
3
  :major: 0
4
4
  :minor: 6
data/lib/dash-merb.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # Depends on non-ActiveSupport fiveruns-dash-ruby (>= 0.8.0)
2
2
  dependency 'fiveruns-dash-ruby', '>= 0.8.0', :require_as => 'fiveruns/dash',
3
3
  :immediate => true
4
- Merb::Config[:dash] = {
4
+ Merb::Config[:dash] ||= {
5
5
  :token => nil,
6
6
  :recipes => [
7
7
  # This recipe can be removed, if desired
@@ -12,5 +12,7 @@ Merb::Config[:dash] = {
12
12
  Merb::BootLoader.after_app_loads do
13
13
  Fiveruns::Dash.logger = Merb.logger
14
14
  require 'fiveruns/dash/merb'
15
- Fiveruns::Dash::Merb.start if Merb::Config[:dash][:token]
15
+ if Merb::Config[:adapter] != 'irb' && Merb::Config[:dash][:token]
16
+ Fiveruns::Dash::Merb.start
17
+ end
16
18
  end
@@ -1,5 +1,28 @@
1
1
  Fiveruns::Dash.register_recipe :merb, :url => 'http://dash.fiveruns.com' do |recipe|
2
- recipe.time 'response_time', :method => 'Merb::Request#dispatch_action'
3
- recipe.counter 'requests', :incremented_by => 'Merb::Request#dispatch_action'
4
- recipe.time 'render_time', :method => 'Merb::RenderMixin#render'
2
+ recipe.time :response_time, :method => 'Merb::Request#dispatch_action'
3
+ recipe.counter :requests, :incremented_by => 'Merb::Request#dispatch_action'
4
+ recipe.time :render_time, :method => 'Merb::RenderMixin#render'
5
+ merb_exceptions = Merb::ControllerExceptions.constants.map do |name|
6
+ "Merb::ControllerExceptions::#{name}"
7
+ end
8
+ recipe.ignore_exceptions do |ex|
9
+ merb_exceptions.include?(ex.class.name)
10
+ end
11
+ recipe.add_exceptions_from 'Merb::Request#dispatch_action' do |ex, request|
12
+ info = {:name => "#{ex.class.name} in #{request.controller}##{request.params[:action]}"}
13
+ # TODO: We shouldn't need to double-serialize to_json -- BW
14
+ begin
15
+ info[:params] = request.params.to_json
16
+ rescue
17
+ Merb.logger.warn "Could not capture request params for exception"
18
+ end
19
+ begin
20
+ info[:environment] = request.env.to_json
21
+ rescue
22
+ Merb.logger.warn "Could not capture request env for exception"
23
+ end
24
+ # TODO: capture session
25
+ # TODO: capture headers
26
+ info
27
+ end
5
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiveruns-dash-merb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - FiveRuns Development Team
@@ -22,6 +22,16 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 0.8.0
24
24
  version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: merb-core
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.0
34
+ version:
25
35
  description: Provides an API to send metrics from Merb 1.0+ applications to the FiveRuns Dash service
26
36
  email: dev@fiveruns.com
27
37
  executables: []