mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix golint warnings/errors on package api/types/
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
This commit is contained in:
parent
818190b1ff
commit
3d6617ffe7
16 changed files with 104 additions and 68 deletions
|
@ -31,9 +31,9 @@ func (s *DockerSuite) TestCliStatsNoStreamGetCpu(c *check.C) {
|
|||
body.Close()
|
||||
|
||||
var cpuPercent = 0.0
|
||||
cpuDelta := float64(v.CpuStats.CpuUsage.TotalUsage - v.PreCpuStats.CpuUsage.TotalUsage)
|
||||
systemDelta := float64(v.CpuStats.SystemUsage - v.PreCpuStats.SystemUsage)
|
||||
cpuPercent = (cpuDelta / systemDelta) * float64(len(v.CpuStats.CpuUsage.PercpuUsage)) * 100.0
|
||||
cpuDelta := float64(v.CPUStats.CPUUsage.TotalUsage - v.PreCPUStats.CPUUsage.TotalUsage)
|
||||
systemDelta := float64(v.CPUStats.SystemUsage - v.PreCPUStats.SystemUsage)
|
||||
cpuPercent = (cpuDelta / systemDelta) * float64(len(v.CPUStats.CPUUsage.PercpuUsage)) * 100.0
|
||||
if cpuPercent == 0 {
|
||||
c.Fatalf("docker stats with no-stream get cpu usage failed: was %v", cpuPercent)
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ func (s *DockerSuite) TestApiNetworkStats(c *check.C) {
|
|||
check.Commentf("Reported less Txbytes than expected. Expected >= %d. Found %d. %s", expRxPkts, nwStatsPost.RxPackets, pingouts))
|
||||
}
|
||||
|
||||
func getNetworkStats(c *check.C, id string) types.Network {
|
||||
func getNetworkStats(c *check.C, id string) types.NetworkStats {
|
||||
var st *types.Stats
|
||||
|
||||
_, body, err := sockRequestRaw("GET", fmt.Sprintf("/containers/%s/stats?stream=false", id), nil, "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue