public class Quantities extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
formatMemory(long bytes) |
static String |
formatMilliCpu(int milliCpu) |
static String |
normalizeCpu(String milliCpu) |
static String |
normalizeMemory(String memory) |
static int |
parseCpuAsMilliCpus(String cpu)
Parse a K8S-style representation of a quantity of cpu, such as
1000m,
into the equivalent number of "millicpus" represented as an int. |
static long |
parseMemory(String memory)
Parse a K8S-style representation of a quantity of memory, such as
512Mi,
into the equivalent number of bytes represented as a long. |
public static long parseMemory(String memory)
512Mi,
into the equivalent number of bytes represented as a long.memory - The String representation of the quantity of memory.public static String formatMemory(long bytes)
public static int parseCpuAsMilliCpus(String cpu)
1000m,
into the equivalent number of "millicpus" represented as an int.cpu - The String representation of the quantity of cpu.public static String formatMilliCpu(int milliCpu)
Copyright © 2019. All rights reserved.