MCPcopy Create free account
hub / github.com/cloudbase/garm / GetInstancesForScaleSet

Method GetInstancesForScaleSet

cache/instance_cache.go:124–136  ·  view source on GitHub ↗
(scaleSetID uint)

Source from the content-addressed store, hash-verified

122}
123
124func (i *InstanceCache) GetInstancesForScaleSet(scaleSetID uint) []params.Instance {
125 i.mux.Lock()
126 defer i.mux.Unlock()
127
128 var filteredInstances []params.Instance
129 for _, instance := range i.cache {
130 if instance.ScaleSetID == scaleSetID {
131 filteredInstances = append(filteredInstances, instance)
132 }
133 }
134 sortByCreationDate(filteredInstances)
135 return filteredInstances
136}
137
138func (i *InstanceCache) GetEntityInstances(entityID string) []params.Instance {
139 pools := GetEntityPools(entityID)

Callers 1

GetInstancesForScaleSetFunction · 0.80

Calls 3

sortByCreationDateFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected