Class: PipelineToolkit::Monitoring::MonitorServer

Inherits:
EM::Connection
  • Object
show all
Includes:
EM::HttpServer
Defined in:
lib/pipeline_toolkit/monitoring/monitor_server.rb

Overview

The http server to monitor the pipeline and report the results.

Instance Method Summary collapse

Constructor Details

#initialize(message_subscriber, options = {}) ⇒ MonitorServer

Initialize a new intance

Parameters:



19
20
21
22
23
# File 'lib/pipeline_toolkit/monitoring/monitor_server.rb', line 19

def initialize(message_subscriber, options = {})
  @options = options
  @message_subscriber = message_subscriber
  @html_template = ERB.new(File.read(File.dirname(__FILE__) + "/monitor.erb"))
end

Instance Method Details

#post_initObject



25
26
27
28
# File 'lib/pipeline_toolkit/monitoring/monitor_server.rb', line 25

def post_init
  super
  no_environment_strings
end

#process_http_requestObject



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/pipeline_toolkit/monitoring/monitor_server.rb', line 30

def process_http_request
  response = EM::DelegatedHttpResponse.new(self)
  response.status = 200
  
  case @http_path_info
  when /.json$/
    process_json(response)
  else
    process_html(response)
  end
          
  response.send_response
end