Class VSphereHostSelection.HostCandidate
java.lang.Object
org.jenkinsci.plugins.vsphere.tools.VSphereHostSelection.HostCandidate
- Enclosing class:
VSphereHostSelection
Describes one candidate host's name, availability and current load,
as needed to decide whether/how favourably it can be used for a new
clone.
-
Constructor Summary
ConstructorsConstructorDescriptionHostCandidate(String name, boolean connected, boolean inMaintenanceMode, Integer cpuUsageMhz, int cpuCapacityMhz, Integer memUsageMB, long memCapacityMB) HostCandidate(String name, boolean connected, boolean inMaintenanceMode, Integer cpuUsageMhz, int cpuCapacityMhz, Integer memUsageMB, long memCapacityMB, int cpuCores) -
Method Summary
Modifier and TypeMethodDescriptiondoubleUnused CPU as a share (0..1) of the host's CPU capacity.doubleUnused CPU in MHz (0 if usage is unknown).doubleUnused memory as a share (0..1) of the host's memory.doubleUnused memory in MB (0 if usage is unknown).intintNumber of physical CPU cores on the host; 0 if unknown.longgetName()booleanbooleanbooleanisUsable()True if the host is currently usable at all (connected and not in maintenance mode), regardless of load.Fraction of capacity currently in use, taking the higher (more constrained) of CPU and memory.
-
Constructor Details
-
HostCandidate
-
HostCandidate
-
-
Method Details
-
getName
-
isConnected
public boolean isConnected() -
isInMaintenanceMode
public boolean isInMaintenanceMode() -
getCpuUsageMhz
-
getCpuCapacityMhz
public int getCpuCapacityMhz() -
getMemUsageMB
-
getMemCapacityMB
public long getMemCapacityMB() -
getCpuCores
public int getCpuCores()Number of physical CPU cores on the host; 0 if unknown. -
loadFraction
Fraction of capacity currently in use, taking the higher (more constrained) of CPU and memory. Returns null if usage stats are missing (stale/unavailable), so the host can be excluded rather than mis-ranked. -
freeCpuMhz
public double freeCpuMhz()Unused CPU in MHz (0 if usage is unknown). -
freeMemMB
public double freeMemMB()Unused memory in MB (0 if usage is unknown). -
freeCpuFraction
public double freeCpuFraction()Unused CPU as a share (0..1) of the host's CPU capacity. -
freeMemFraction
public double freeMemFraction()Unused memory as a share (0..1) of the host's memory. -
isUsable
public boolean isUsable()True if the host is currently usable at all (connected and not in maintenance mode), regardless of load.
-