Exemple #1
0
func (c *containerStatsContext) MemUsage() string {
	c.AddHeader(memUseHeader)
	if c.s.IsInvalid || c.s.OSType == winOSType {
		return fmt.Sprintf("-- / --")
	}
	return fmt.Sprintf("%s / %s", units.BytesSize(c.s.Memory), units.BytesSize(c.s.MemoryLimit))
}
Exemple #2
0
func (m *memBytes) String() string {
	return units.BytesSize(float64(m.Value()))
}
Exemple #3
0
func (ctx *serviceInspectContext) ResourceLimitMemory() string {
	if ctx.Service.Spec.TaskTemplate.Resources.Limits.MemoryBytes == 0 {
		return ""
	}
	return units.BytesSize(float64(ctx.Service.Spec.TaskTemplate.Resources.Limits.MemoryBytes))
}