Class: Content::Pulp::RepositorySyncHistory
- Inherits:
-
Object
- Object
- Content::Pulp::RepositorySyncHistory
- Defined in:
- app/services/content/pulp/repository_sync_history.rb
Instance Attribute Summary collapse
-
#added_count ⇒ Object
readonly
Returns the value of attribute added_count.
-
#completed ⇒ Object
readonly
Returns the value of attribute completed.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#removed_count ⇒ Object
readonly
Returns the value of attribute removed_count.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#started ⇒ Object
readonly
Returns the value of attribute started.
-
#updated_count ⇒ Object
readonly
Returns the value of attribute updated_count.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ RepositorySyncHistory
constructor
A new instance of RepositorySyncHistory.
- #metrics ⇒ Object
- #status ⇒ Object
- #times ⇒ Object
Constructor Details
#initialize(attrs) ⇒ RepositorySyncHistory
Returns a new instance of RepositorySyncHistory.
5 6 7 8 9 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 5 def initialize(attrs) attrs.each do |k, v| instance_variable_set("@#{k}", v) if respond_to?("#{k}".to_sym) end end |
Instance Attribute Details
#added_count ⇒ Object (readonly)
Returns the value of attribute added_count.
2 3 4 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 2 def added_count @added_count end |
#completed ⇒ Object (readonly)
Returns the value of attribute completed.
2 3 4 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 2 def completed @completed end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
2 3 4 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 2 def details @details end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
2 3 4 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 2 def @error_message end |
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
2 3 4 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 2 def exception @exception end |
#removed_count ⇒ Object (readonly)
Returns the value of attribute removed_count.
2 3 4 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 2 def removed_count @removed_count end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
2 3 4 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 2 def result @result end |
#started ⇒ Object (readonly)
Returns the value of attribute started.
2 3 4 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 2 def started @started end |
#updated_count ⇒ Object (readonly)
Returns the value of attribute updated_count.
2 3 4 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 2 def updated_count @updated_count end |
Instance Method Details
#metrics ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 19 def metrics { :updated => updated_count, :removed => removed_count, :added => added_count, } end |
#status ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 27 def status { :result => result, :message => || summary['error'], :completed => completed } end |
#times ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/services/content/pulp/repository_sync_history.rb', line 11 def times { :comps => summary[:time_total_sec], :errata => summary[:errata_time_total_sec], :packages => (summary[:packages][:time_total_sec] rescue 0) } end |