Module: Fiveruns::Dash::Merb

Defined in:
lib/fiveruns/dash/merb.rb

Class Method Summary collapse

Class Method Details

.autoadd_ormObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/fiveruns/dash/merb.rb', line 17

def self.autoadd_orm
  return if !::Merb.orm || !::Merb::Config[:dash][:autoadd_orm]
  require "fiveruns-dash-#{::Merb.orm}"
  ::Merb::Config[:dash][:recipes].push([
    ::Merb.orm,
    {
      :url => 'http://dash.fiveruns.com',
      :total_time => 'response_time'
    }
  ])
  Fiveruns::Dash.logger.info "Auto-added recipe for ORM from fiveruns-dash-#{::Merb.orm}"
rescue LoadError
  Fiveruns::Dash.logger.warn "Could not auto-add recipe for ORM from fiveruns-dash-#{::Merb.orm}"
end

.startObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/fiveruns/dash/merb.rb', line 6

def self.start
  ::Fiveruns::Dash.logger.info "Starting FiveRuns Dash"
  Fiveruns::Dash.start(:app => ::Merb::Config[:dash][:token]) do |config|
    Array(::Merb::Config[:dash][:recipes]).each do |set|
      name, options = Array(set)
      ::Fiveruns::Dash.logger.debug "Adding FiveRuns Dash recipe: #{set.inspect}"
      config.add_recipe(name, options)
    end
  end
end