sedai.measurement
The unit a MetricValue is expressed in. Only a subset of these units is valid for
any one kind of measurement - see MetricValue.allowed_units.
Thousandths of a CPU core. This is the unit behind Kubernetes' 250m notation.
A virtual CPU. Equivalent to a core for Kubernetes, and to 1024 CPU units for ECS.
Binary kibibytes (1024 bytes). This is the unit behind Kubernetes' 512Ki notation.
Binary mebibytes (1024^2 bytes). This is the unit ECS task definitions use for memory.
A measurement expressed as a number together with the unit that number is in. This is the base class for K8sCpuValue, ECSCpuValue and MemoryValue; use one of those rather than this class directly.
Parameters
- value: The magnitude of the measurement.
Noneleaves the measurement unset. - metricUnit: The unit
valueis in. Defaults to the base unit for this kind of measurement - cores for Kubernetes cpu, CPU units for ECS cpu, bytes for memory.
Raises
- ValueError: If
metricUnitis not a valid unit for this kind of measurement.
The magnitude of the measurement, in metricUnit. None means the measurement is not set -
for a guardrail that means the guardrail is unbounded and Sedai applies its own default.
The unit value is expressed in. The API rejects a measurement with no unit, so this is
always one of allowed_units.
The units this kind of measurement can be expressed in.
This measurement converted to metricUnit.
Parameters
- metricUnit: The unit to convert to.
Returns
The converted magnitude, or
Noneif the measurement is not set.
Raises
- ValueError: If
metricUnitis not a valid unit for this kind of measurement.
A Kubernetes cpu measurement, such as a per-container cpu guardrail. A bare number with no unit
is taken to be in MetricUnit.CORES.
Inherited Members
An ECS cpu measurement, such as the minimum cpu guardrail for an ECS service. A bare number with
no unit is taken to be in MetricUnit.CPU_UNITS.
This measurement in ECS CPU units, or None if it is not set.
Inherited Members
A memory measurement, such as a per-container memory guardrail. A bare number with no unit is
taken to be in MetricUnit.BYTES.
This measurement in mebibytes (1024^2 bytes), or None if it is not set.
This measurement in gibibytes (1024^3 bytes), or None if it is not set.
This measurement in decimal gigabytes (1000^3 bytes), or None if it is not set.