Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v2_1_2@240
Fetching contributors…

Cannot retrieve contributors at this time

file 26 lines (20 sloc) 0.833 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
require 'yaml'
require 'seldon/agent'

# Initializer for the Seldon Agent
seldon_config_file = File.read(RAILS_ROOT+"/config/seldon.yml")
seldon_agent_config = YAML.load(seldon_config_file)[RAILS_ENV]
seldon_agent_config.freeze

::SELDON_AGENT_ENABLED = seldon_agent_config['enabled']
::SELDON_DEVELOPER = seldon_agent_config['enabled'] && seldon_agent_config['developer']

if ::SELDON_AGENT_ENABLED
  require 'seldon/agent/instrument_rails'
  
  ::SELDON_HOST = seldon_agent_config['host']
  ::SELDON_PORT = seldon_agent_config['port']

  Seldon::Agent.instance.start(seldon_agent_config)
  
  if ::SELDON_DEVELOPER
    controller_path = File.join(File.dirname(__FILE__), 'ui', 'controllers')
    $LOAD_PATH << controller_path
    Dependencies.load_paths << controller_path
    config.controller_paths << controller_path
  end
end
Something went wrong with that request. Please try again.