Class Wrapper
java.lang.Object
de.rexlcloud.core.api.Wrapper
- All Implemented Interfaces:
Serializable
A wrapper (a machine that runs servers) as the API sees it, with the resource usage it last reported.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandoubleCPU load of the wrapper's machine from 0 to 1; negative if unknown.long@NonNull StringgetName()Name of the wrapper, e.g.longlongMemory of the machine in bytes: in use, available to new servers (including the page cache the system gives back) and in total.inthashCode()booleanisOnline()Whether the wrapper is connected to the master.protected voidInternal: applies a newer state of the wrapper.
-
Constructor Details
-
Wrapper
public Wrapper(@NonNull @NonNull String name, boolean online, double cpuUsage, long usedMemory, long freeMemory, long totalMemory) Creates a newWrapperinstance.- Parameters:
name- Name of the wrapper, e.g.Wrapper-1.online- Whether the wrapper is connected to the master.cpuUsage- CPU load of the wrapper's machine from 0 to 1; negative if unknown.usedMemory- Memory of the machine in bytes: in use, available to new servers (including the page cache the system gives back) and in total.freeMemory-totalMemory-
-
-
Method Details
-
update
Internal: applies a newer state of the wrapper. -
getCpuUsagePercent
- Returns:
- the CPU load as text, e.g.
12.50%
-
getTotalMemoryString
- Returns:
- the total memory in GB as text, e.g.
15.62
-
getUsedMemoryString
- Returns:
- the memory in use in GB as text
-
getFreeMemoryString
- Returns:
- the available memory in GB as text
-
equals
-
hashCode
-
getName
Name of the wrapper, e.g.Wrapper-1. -
isOnline
public boolean isOnline()Whether the wrapper is connected to the master. -
getCpuUsage
public double getCpuUsage()CPU load of the wrapper's machine from 0 to 1; negative if unknown. -
getUsedMemory
public long getUsedMemory()Memory of the machine in bytes: in use, available to new servers (including the page cache the system gives back) and in total. -
getFreeMemory
public long getFreeMemory() -
getTotalMemory
public long getTotalMemory()
-