Class: ChronoForge::Dashboard::BranchesPresenter::Merge

Inherits:
Struct
  • Object
show all
Defined in:
app/presenters/chrono_forge/dashboard/branches_presenter.rb

Overview

One merge join (a merge$ log = a BranchMergeJob's durable target). state: :merging (pending — a poller is joining) | :merged (completed). The poll fields are the BranchMergeJob's observable cadence (it stamps them on the target branch logs each pass): when it last checked, when it's scheduled to check next, and how many times it has polled.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#eta_secondsObject

Returns the value of attribute eta_seconds

Returns:

  • (Object)

    the current value of eta_seconds



12
13
14
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 12

def eta_seconds
  @eta_seconds
end

#last_polled_atObject

Returns the value of attribute last_polled_at

Returns:

  • (Object)

    the current value of last_polled_at



12
13
14
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 12

def last_polled_at
  @last_polled_at
end

#namesObject

Returns the value of attribute names

Returns:

  • (Object)

    the current value of names



12
13
14
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 12

def names
  @names
end

#next_poll_atObject

Returns the value of attribute next_poll_at

Returns:

  • (Object)

    the current value of next_poll_at



12
13
14
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 12

def next_poll_at
  @next_poll_at
end

#pollsObject

Returns the value of attribute polls

Returns:

  • (Object)

    the current value of polls



12
13
14
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 12

def polls
  @polls
end

#rateObject

Returns the value of attribute rate

Returns:

  • (Object)

    the current value of rate



12
13
14
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 12

def rate
  @rate
end

#started_atObject

Returns the value of attribute started_at

Returns:

  • (Object)

    the current value of started_at



12
13
14
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 12

def started_at
  @started_at
end

#stateObject

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



12
13
14
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 12

def state
  @state
end

Instance Method Details

#merging?Boolean

Returns:

  • (Boolean)


13
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 13

def merging? = state == :merging

#poll_overdue?Boolean

A next check scheduled in the past while still merging means the poller was dropped (or is overdue) — the join is stuck until it's re-armed.

Returns:

  • (Boolean)


17
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 17

def poll_overdue? = merging? && next_poll_at && next_poll_at.past?

#throughput?Boolean

Throughput is a live gauge — only meaningful while merging and actually draining (rate 0.0 means idle; a merged join has no live rate).

Returns:

  • (Boolean)


21
# File 'app/presenters/chrono_forge/dashboard/branches_presenter.rb', line 21

def throughput? = merging? && rate.to_f > 0