Class: Refinery::Statistics
- Inherits:
-
Object
- Object
- Refinery::Statistics
- Includes:
- Loggable
- Defined in:
- lib/refinery/statistics.rb
Overview
The statistics class provides a means to record runtime stats about completed jobs and errors. The stats are stored in a SQL database (using SQLite3 by default).
Instance Method Summary collapse
-
#record_done(message) ⇒ Object
Record the done record into the.
-
#record_error(message) ⇒ Object
Record the error message into the statistics database.
Methods included from Loggable
Instance Method Details
#record_done(message) ⇒ Object
Record the done record into the
9 10 11 12 13 14 15 16 17 |
# File 'lib/refinery/statistics.rb', line 9 def record_done() db[:completed_jobs] << { :host => ['host_info']['hostname'], :pid => ['host_info']['pid'], :run_time => ['run_time'], :original_message => ['original'], :when => Time.now } end |
#record_error(message) ⇒ Object
Record the error message into the statistics database.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/refinery/statistics.rb', line 20 def record_error() db[:errors] << { :host => ['host_info']['hostname'], :pid => ['host_info']['pid'], :error_class => ['error']['class'], :error_message => ['error']['message'], :original_message => ['original'], :when => Time.now } end |