Class PluginResources
- java.lang.Object
-
- org.hansken.plugin.extraction.api.PluginResources
-
public final class PluginResources extends Object
PluginResources contains information about how many resources will be used for a plugin. The most common resources to specify are CPU and memory (RAM).CPU resources are measured in cpu units. One cpu is equivalent to 1 vCPU/Core for cloud providers and 1 hyperthread on bare-metal Intel processors. Also, fractional requests are allowed. A plugin that asks 0.5 CPU uses half as much CPU as one that asks for 1 CPU.
Memory resources are measured in Megabytes.
Here is an example to set resources for a plugin:
In this example the plugin has a limit of 1 cpu and 1G of memory.Resources.builder() .maximumCpu("1.5") .maximumMemory("1024") .build();
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PluginResources.Builder
Builder forPluginResources
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PluginResources.Builder
builder()
Float
maximumCpu()
Integer
maximumMemory()
Integer
maximumWorkers()
-
-
-
Method Detail
-
maximumCpu
public Float maximumCpu()
-
maximumMemory
public Integer maximumMemory()
-
maximumWorkers
public Integer maximumWorkers()
-
builder
public static PluginResources.Builder builder()
-
-