Class: Rafflesia::JobMetricsData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::JobMetricsData
- Defined in:
- lib/rafflesia/jobs/job_metrics_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ error_jobs: :error_jobs, newest_created_at: :newest_created_at, non_terminal_jobs: :non_terminal_jobs, oldest_queued_at: :oldest_queued_at, oldest_running_at: :oldest_running_at, operation_status_counts: :operation_status_counts, queue: :queue, queue_error: :queue_error, snapshot_at: :snapshot_at, stale_running_jobs: :stale_running_jobs, status_counts: :status_counts, terminal_jobs: :terminal_jobs, total_jobs: :total_jobs }.freeze
Instance Attribute Summary collapse
-
#error_jobs ⇒ Object
Returns the value of attribute error_jobs.
-
#newest_created_at ⇒ Object
Returns the value of attribute newest_created_at.
-
#non_terminal_jobs ⇒ Object
Returns the value of attribute non_terminal_jobs.
-
#oldest_queued_at ⇒ Object
Returns the value of attribute oldest_queued_at.
-
#oldest_running_at ⇒ Object
Returns the value of attribute oldest_running_at.
-
#operation_status_counts ⇒ Object
Returns the value of attribute operation_status_counts.
-
#queue ⇒ Object
Returns the value of attribute queue.
-
#queue_error ⇒ Object
Returns the value of attribute queue_error.
-
#snapshot_at ⇒ Object
Returns the value of attribute snapshot_at.
-
#stale_running_jobs ⇒ Object
Returns the value of attribute stale_running_jobs.
-
#status_counts ⇒ Object
Returns the value of attribute status_counts.
-
#terminal_jobs ⇒ Object
Returns the value of attribute terminal_jobs.
-
#total_jobs ⇒ Object
Returns the value of attribute total_jobs.
Instance Method Summary collapse
-
#initialize(json) ⇒ JobMetricsData
constructor
A new instance of JobMetricsData.
Constructor Details
#initialize(json) ⇒ JobMetricsData
Returns a new instance of JobMetricsData.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 39 def initialize(json) super() hash = self.class.normalize(json) @error_jobs = hash[:error_jobs] @newest_created_at = hash[:newest_created_at] @non_terminal_jobs = hash[:non_terminal_jobs] @oldest_queued_at = hash[:oldest_queued_at] @oldest_running_at = hash[:oldest_running_at] @operation_status_counts = (hash[:operation_status_counts] || []).map { |item| item ? Rafflesia::JobOperationStatusCount.new(item) : nil } @queue = hash[:queue] ? Rafflesia::JobQueueInfo.new(hash[:queue]) : nil @queue_error = hash[:queue_error] @snapshot_at = hash[:snapshot_at] @stale_running_jobs = hash[:stale_running_jobs] @status_counts = (hash[:status_counts] || []).map { |item| item ? Rafflesia::JobStatusCount.new(item) : nil } @terminal_jobs = hash[:terminal_jobs] @total_jobs = hash[:total_jobs] end |
Instance Attribute Details
#error_jobs ⇒ Object
Returns the value of attribute error_jobs.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def error_jobs @error_jobs end |
#newest_created_at ⇒ Object
Returns the value of attribute newest_created_at.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def newest_created_at @newest_created_at end |
#non_terminal_jobs ⇒ Object
Returns the value of attribute non_terminal_jobs.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def non_terminal_jobs @non_terminal_jobs end |
#oldest_queued_at ⇒ Object
Returns the value of attribute oldest_queued_at.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def oldest_queued_at @oldest_queued_at end |
#oldest_running_at ⇒ Object
Returns the value of attribute oldest_running_at.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def oldest_running_at @oldest_running_at end |
#operation_status_counts ⇒ Object
Returns the value of attribute operation_status_counts.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def operation_status_counts @operation_status_counts end |
#queue ⇒ Object
Returns the value of attribute queue.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def queue @queue end |
#queue_error ⇒ Object
Returns the value of attribute queue_error.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def queue_error @queue_error end |
#snapshot_at ⇒ Object
Returns the value of attribute snapshot_at.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def snapshot_at @snapshot_at end |
#stale_running_jobs ⇒ Object
Returns the value of attribute stale_running_jobs.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def stale_running_jobs @stale_running_jobs end |
#status_counts ⇒ Object
Returns the value of attribute status_counts.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def status_counts @status_counts end |
#terminal_jobs ⇒ Object
Returns the value of attribute terminal_jobs.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def terminal_jobs @terminal_jobs end |
#total_jobs ⇒ Object
Returns the value of attribute total_jobs.
24 25 26 |
# File 'lib/rafflesia/jobs/job_metrics_data.rb', line 24 def total_jobs @total_jobs end |