Module: RemoteLogging
- Defined in:
- lib/remote_log.rb
Overview
RemoteLogging provides callers with a mechanism by which they can save information about when the AppScale tools are successfully used. Callers should use these methods to indicate when AppScale has failed to start, and possibly any information that can be used to debug the problem.
Constant Summary collapse
- REMOTE_URL =
The location where the Google App Engine application runs that stores profiling information about how often the AppScale tools run successfully.
"http://heart-beat.appspot.com/sign2"
Class Method Summary collapse
-
.post(params) ⇒ Object
Posts a Hash of parameters to the Google App Engine application that keeps statistics about when AppScale was started successfully or failed.
-
.remote_post(num_nodes, database, infrastructure, state, success) ⇒ Object
Provides a convenient interface to self.post that callers can use to save profiling information about running the AppScale tools.
Class Method Details
.post(params) ⇒ Object
Posts a Hash of parameters to the Google App Engine application that keeps statistics about when AppScale was started successfully or failed.
36 37 38 39 40 41 42 43 |
# File 'lib/remote_log.rb', line 36 def self.post(params) begin uri = URI.parse(REMOTE_URL) response = Net::HTTP.post_form(uri, params) return response.body rescue Exception # e.g., if the app is unresponsive end end |
.remote_post(num_nodes, database, infrastructure, state, success) ⇒ Object
Provides a convenient interface to self.post that callers can use to save profiling information about running the AppScale tools.
23 24 25 26 27 28 29 30 31 |
# File 'lib/remote_log.rb', line 23 def self.remote_post(num_nodes, database, infrastructure, state, success) params = {"key" => "appscale", "infras" => infrastructure, "num_nodes" => "#{num_nodes}", "state" => state, "success" => success, "db" => database} self.post(params) end |