Class: Content::Pulp::RepositorySyncHistory

Inherits:
Object
  • Object
show all
Defined in:
app/services/content/pulp/repository_sync_history.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_countObject (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

#completedObject (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

#detailsObject (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_messageObject (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
  @error_message
end

#exceptionObject (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_countObject (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

#resultObject (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

#startedObject (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_countObject (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

#metricsObject



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

#statusObject



27
28
29
30
31
32
33
# File 'app/services/content/pulp/repository_sync_history.rb', line 27

def status
  {
    :result    => result,
    :message   => error_message || summary['error'],
    :completed => completed
  }
end

#timesObject



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