示例#1
0
文件: stats.go 项目: wayneiny/docker
func (c *containerStatsContext) BlockIO() string {
	c.AddHeader(blockIOHeader)
	if c.s.IsInvalid {
		return fmt.Sprintf("--")
	}
	return fmt.Sprintf("%s / %s", units.HumanSizeWithPrecision(c.s.BlockRead, 3), units.HumanSizeWithPrecision(c.s.BlockWrite, 3))
}
示例#2
0
文件: stats.go 项目: wayneiny/docker
func (c *containerStatsContext) NetIO() string {
	c.AddHeader(netIOHeader)
	if c.s.IsInvalid {
		return fmt.Sprintf("--")
	}
	return fmt.Sprintf("%s / %s", units.HumanSizeWithPrecision(c.s.NetworkRx, 3), units.HumanSizeWithPrecision(c.s.NetworkTx, 3))
}
示例#3
0
func (c *containerContext) Size() string {
	c.AddHeader(sizeHeader)
	srw := units.HumanSizeWithPrecision(float64(c.c.SizeRw), 3)
	sv := units.HumanSizeWithPrecision(float64(c.c.SizeRootFs), 3)

	sf := srw
	if c.c.SizeRootFs > 0 {
		sf = fmt.Sprintf("%s (virtual %s)", srw, sv)
	}
	return sf
}
示例#4
0
文件: image.go 项目: Mic92/docker
func (c *imageContext) Size() string {
	c.AddHeader(sizeHeader)
	//NOTE: For backward compatibility we need to return VirtualSize
	return units.HumanSizeWithPrecision(float64(c.i.VirtualSize), 3)
}
示例#5
0
文件: image.go 项目: CWSpear/docker
func (c *imageContext) Size() string {
	c.AddHeader(sizeHeader)
	return units.HumanSizeWithPrecision(float64(c.i.Size), 3)
}