mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
fix gofmt
This commit is contained in:
parent
3764360ccc
commit
99a7a0a53b
@ -207,7 +207,7 @@ func (p *perfCounterNodeStatsClient) convertCPUValue(cpuCores int, cpuValue uint
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *perfCounterNodeStatsClient) getCPUUsageNanoCores() uint64 {
|
func (p *perfCounterNodeStatsClient) getCPUUsageNanoCores() uint64 {
|
||||||
cpuUsageNanoCores := (p.cpuUsageCoreNanoSecondsCache.latestValue - p.cpuUsageCoreNanoSecondsCache.previousValue) * uint64(time.Second / time.Nanosecond) / uint64(defaultCachePeriod)
|
cpuUsageNanoCores := (p.cpuUsageCoreNanoSecondsCache.latestValue - p.cpuUsageCoreNanoSecondsCache.previousValue) * uint64(time.Second/time.Nanosecond) / uint64(defaultCachePeriod)
|
||||||
return cpuUsageNanoCores
|
return cpuUsageNanoCores
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ func TestConvertCPUValue(t *testing.T) {
|
|||||||
func TestGetCPUUsageNanoCores(t *testing.T) {
|
func TestGetCPUUsageNanoCores(t *testing.T) {
|
||||||
p := perfCounterNodeStatsClient{}
|
p := perfCounterNodeStatsClient{}
|
||||||
p.cpuUsageCoreNanoSecondsCache = cpuUsageCoreNanoSecondsCache{
|
p.cpuUsageCoreNanoSecondsCache = cpuUsageCoreNanoSecondsCache{
|
||||||
latestValue: uint64(5000000000),
|
latestValue: uint64(5000000000),
|
||||||
previousValue: uint64(2000000000),
|
previousValue: uint64(2000000000),
|
||||||
}
|
}
|
||||||
cpuUsageNanoCores := p.getCPUUsageNanoCores()
|
cpuUsageNanoCores := p.getCPUUsageNanoCores()
|
||||||
|
Loading…
Reference in New Issue
Block a user