MCPcopy Create free account
hub / github.com/coder/coder / countEligible

Method countEligible

coderd/prebuilds/preset_snapshot.go:442–450  ·  view source on GitHub ↗

countEligible returns the number of prebuilds that are ready to be claimed. A prebuild is eligible if it's running and its agents are in ready state.

()

Source from the content-addressed store, hash-verified

440// countEligible returns the number of prebuilds that are ready to be claimed.
441// A prebuild is eligible if it's running and its agents are in ready state.
442func (p PresetSnapshot) countEligible() int32 {
443 var count int32
444 for _, prebuild := range p.Running {
445 if prebuild.Ready {
446 count++
447 }
448 }
449 return count
450}
451
452// countInProgress returns counts of prebuilds in transition states (starting, stopping, deleting).
453// These counts are tracked at the template level, so all presets sharing the same template see the same values.

Callers 1

CalculateStateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected