Module: Fiveruns::Dash

Includes:
Threads
Defined in:
lib/fiveruns/dash.rb,
lib/fiveruns/dash/scm.rb,
lib/fiveruns/dash/host.rb,
lib/fiveruns/dash/util.rb,
lib/fiveruns/dash/trace.rb,
lib/fiveruns/dash/metric.rb,
lib/fiveruns/dash/recipe.rb,
lib/fiveruns/dash/update.rb,
lib/fiveruns/dash/session.rb,
lib/fiveruns/dash/threads.rb,
lib/fiveruns/dash/typable.rb,
lib/fiveruns/dash/version.rb,
lib/fiveruns/dash/reporter.rb,
lib/fiveruns/dash/instrument.rb,
lib/fiveruns/dash/configuration.rb,
lib/fiveruns/dash/exception_recorder.rb

Defined Under Namespace

Modules: Context, Instrument, Store, Threads, Typable, Util Classes: AbsoluteMetric, Configuration, CounterMetric, DataPayload, ExceptionRecorder, ExceptionsPayload, GitSCM, Host, InfoPayload, Metric, Payload, PercentageMetric, PingPayload, Pinger, Recipe, Reporter, SCM, Session, ShutdownSignal, SvnSCM, TimeMetric, Trace, TracePayload, Update, Version

Constant Summary collapse

START_TIME =
Time.now.utc

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Threads

included

Class Attribute Details

.trace_contextsObject

Returns the value of attribute trace_contexts.



91
92
93
# File 'lib/fiveruns/dash.rb', line 91

def trace_contexts
  @trace_contexts
end

Class Method Details

.configure(options = {}) {|configuration| ... } ⇒ Object

Yields:

  • (configuration)


69
70
71
72
73
# File 'lib/fiveruns/dash.rb', line 69

def self.configure(options = {})
  handle_pwd_is_root(caller[0]) if Dir.pwd == '/'      
  configuration.options.update(options)
  yield configuration if block_given?
end

.hostObject



80
81
82
# File 'lib/fiveruns/dash.rb', line 80

def self.host
  @host ||= Host.new
end

.loggerObject



55
56
57
58
59
60
61
62
63
# File 'lib/fiveruns/dash.rb', line 55

def self.logger
  @logger ||= begin
    if defined?(RAILS_DEFAULT_LOGGER)
      RAILS_DEFAULT_LOGGER
    else
      Logger.new(STDOUT)
    end
  end
end

.logger=(logger) ⇒ Object



65
66
67
# File 'lib/fiveruns/dash.rb', line 65

def self.logger=(logger)
  @logger = logger
end

.process_ageObject



51
52
53
# File 'lib/fiveruns/dash.rb', line 51

def self.process_age
  Time.now.utc - START_TIME
end

.recipesObject



104
105
106
# File 'lib/fiveruns/dash.rb', line 104

def self.recipes
  @recipes ||= {}
end

.register_recipe(name, options = {}, &block) ⇒ Object



94
95
96
97
98
99
100
101
102
# File 'lib/fiveruns/dash.rb', line 94

def self.register_recipe(name, options = {}, &block)
  recipes[name] ||= []
  recipe = Recipe.new(name, options, &block)
  if recipes[name].include?(recipe)
    logger.info "Skipping re-registration of recipe :#{name} #{options.inspect}"
  else
    recipes[name] << recipe
  end
end

.scmObject



84
85
86
87
88
# File 'lib/fiveruns/dash.rb', line 84

def self.scm
  @scm ||= unless configuration.options[:scm] == false
    SCM.matching(configuration.options[:scm_repo])
  end
end

.start(options = {}, &block) ⇒ Object



75
76
77
78
# File 'lib/fiveruns/dash.rb', line 75

def self.start(options = {}, &block)
  configure(options, &block) if block_given?
  session.start
end