Module: Rearview
- Includes:
- Logger
- Defined in:
- lib/rearview/log_formatter.rb,
lib/rearview.rb,
lib/rearview/vm.rb,
lib/rearview/alerts.rb,
lib/rearview/engine.rb,
lib/rearview/logger.rb,
lib/rearview/statsd.rb,
lib/rearview/version.rb,
app/models/rearview/job.rb,
lib/rearview/distribute.rb,
lib/rearview/stats_task.rb,
lib/rearview/url_helper.rb,
app/models/rearview/user.rb,
lib/rearview/alerts/base.rb,
lib/rearview/cron_helper.rb,
lib/rearview/monitor_task.rb,
lib/rearview/configuration.rb,
lib/rearview/stats_service.rb,
lib/rearview/alerts_handler.rb,
lib/rearview/monitor_runner.rb,
app/models/rearview/job_data.rb,
lib/rearview/monitor_service.rb,
lib/rearview/results_handler.rb,
app/models/rearview/dashboard.rb,
app/models/rearview/job_error.rb,
lib/rearview/ext/state_machine.rb,
lib/rearview/metrics_validator.rb,
lib/rearview/alerts/email_alert.rb,
lib/rearview/monitor_supervisor.rb,
app/mailers/rearview/alert_mailer.rb,
lib/rearview/alerts/campfire_alert.rb,
lib/rearview/alerts/pagerduty_alert.rb,
lib/rearview/constants_module_maker.rb,
lib/rearview/metrics_validator_task.rb,
lib/rearview/cron_expression_validator.rb,
lib/rearview/metrics_validator_service.rb,
app/helpers/rearview/application_helper.rb,
app/controllers/rearview/home_controller.rb,
app/controllers/rearview/jobs_controller.rb,
app/controllers/rearview/user_controller.rb,
lib/generators/rearview/install_generator.rb,
app/controllers/rearview/monitor_controller.rb,
app/controllers/rearview/dashboards_controller.rb,
app/mailers/rearview/metrics_validation_mailer.rb,
app/controllers/rearview/application_controller.rb,
app/controllers/rearview/dashboard_children_controller.rb
Overview
copied from logger.rb
Defined Under Namespace
Modules: Alerts, ApplicationHelper, Concerns, ConstantsModuleMaker, CronHelper, Distribute, Ext, Generators, Logger Classes: AlertMailer, AlertsHandler, ApplicationController, Configuration, CronExpressionValidator, Dashboard, DashboardChildrenController, DashboardsController, Engine, HomeController, Job, JobData, JobError, JobsController, LogFormatter, MetricsValidationMailer, MetricsValidator, MetricsValidatorService, MetricsValidatorTask, MonitorController, MonitorRunner, MonitorService, MonitorSupervisor, MonitorTask, ResultsHandler, StatsService, StatsTask, Statsd, UrlHelper, User, UserController, Vm
Constant Summary collapse
- VERSION =
"1.2.3"
Class Attribute Summary collapse
-
.alert_clients ⇒ Object
Returns the value of attribute alert_clients.
-
.monitor_service ⇒ Object
Returns the value of attribute monitor_service.
-
.stats_service ⇒ Object
Returns the value of attribute stats_service.
-
.validator_service ⇒ Object
Returns the value of attribute validator_service.
Class Method Summary collapse
- .boot! ⇒ Object
- .booted? ⇒ Boolean
- .config ⇒ Object
- .configure {|config| ... } ⇒ Object
- .logger ⇒ Object
- .logger=(logger) ⇒ Object
Class Attribute Details
.alert_clients ⇒ Object
Returns the value of attribute alert_clients.
35 36 37 |
# File 'lib/rearview.rb', line 35 def alert_clients @alert_clients end |
.monitor_service ⇒ Object
Returns the value of attribute monitor_service.
35 36 37 |
# File 'lib/rearview.rb', line 35 def monitor_service @monitor_service end |
.stats_service ⇒ Object
Returns the value of attribute stats_service.
35 36 37 |
# File 'lib/rearview.rb', line 35 def stats_service @stats_service end |
.validator_service ⇒ Object
Returns the value of attribute validator_service.
35 36 37 |
# File 'lib/rearview.rb', line 35 def validator_service @validator_service end |
Class Method Details
.boot! ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/rearview.rb', line 60 def boot! Celluloid.logger = @logger = config.logger if(config.logger.present?) logger.info "booting..." logger.info "using configuration: \n#{config.dump}" if config.verify? unless config.valid? logger.warn "configuration check FAILED: \n#{config.errors..join("\n")}" end end jobs = ( config.preload_jobs? ? Job.schedulable : [] ) logger.info "starting up monitor service for (#{jobs.count}) job(s)" @monitor_service = Rearview::MonitorService.new(jobs) if config.monitor_enabled? @monitor_service.startup else logger.warn "monitor disabled!" end if config.stats_enabled? @stats_service = Rearview::StatsService.supervise @stats_service.actors.first.startup end if config.metrics_validator_enabled? @validator_service = Rearview::MetricsValidatorService.supervise @validator_service.actors.first.startup end @alert_clients = Rearview::Alerts.registry.values @booted = true end |
.booted? ⇒ Boolean
48 49 50 |
# File 'lib/rearview.rb', line 48 def booted? @booted end |
.config ⇒ Object
56 57 58 |
# File 'lib/rearview.rb', line 56 def config @config ||= Rearview::Configuration.new end |
.configure {|config| ... } ⇒ Object
52 53 54 |
# File 'lib/rearview.rb', line 52 def configure yield config end |
.logger ⇒ Object
40 41 42 |
# File 'lib/rearview.rb', line 40 def logger @logger ||= Rails.logger end |
.logger=(logger) ⇒ Object
44 45 46 |
# File 'lib/rearview.rb', line 44 def logger=(logger) @logger = logger end |