Skip to content

Commit

Permalink
fix type errors
Browse files Browse the repository at this point in the history
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
  • Loading branch information
szuecs committed Nov 4, 2022
1 parent c51a1fb commit 145c93e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions events.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ information is displayed once every 5 seconds.`,
},
}

func convertPSI(from *cgroups.PSIData, to *types.PSIData) {
func convertPSI(from *cgroups.PSIData, to *cgroups.PSIData) {
to.Avg10 = from.Avg10
to.Avg60 = from.Avg60
to.Avg300 = from.Avg300
Expand All @@ -136,8 +136,8 @@ func convertLibcontainerStats(ls *libcontainer.Stats) *types.Stats {
s.CPU.Throttling.Periods = cg.CpuStats.ThrottlingData.Periods
s.CPU.Throttling.ThrottledPeriods = cg.CpuStats.ThrottlingData.ThrottledPeriods
s.CPU.Throttling.ThrottledTime = cg.CpuStats.ThrottlingData.ThrottledTime
convertPSI(&cg.CpuStats.PSI.Some, &s.CPU.PSI.Some)
convertPSI(&cg.CpuStats.PSI.Full, &s.CPU.PSI.Full)
convertPSI(cg.CpuStats.PSI.Some, s.CPU.PSI.Some)
convertPSI(cg.CpuStats.PSI.Full, s.CPU.PSI.Full)

s.CPUSet = types.CPUSet(cg.CPUSetStats)

Expand All @@ -147,8 +147,8 @@ func convertLibcontainerStats(ls *libcontainer.Stats) *types.Stats {
s.Memory.Swap = convertMemoryEntry(cg.MemoryStats.SwapUsage)
s.Memory.Usage = convertMemoryEntry(cg.MemoryStats.Usage)
s.Memory.Raw = cg.MemoryStats.Stats
convertPSI(&cg.MemoryStats.PSI.Some, &s.Memory.PSI.Some)
convertPSI(&cg.MemoryStats.PSI.Full, &s.Memory.PSI.Full)
convertPSI(cg.MemoryStats.PSI.Some, s.Memory.PSI.Some)
convertPSI(cg.MemoryStats.PSI.Full, s.Memory.PSI.Full)

s.Blkio.IoServiceBytesRecursive = convertBlkioEntry(cg.BlkioStats.IoServiceBytesRecursive)
s.Blkio.IoServicedRecursive = convertBlkioEntry(cg.BlkioStats.IoServicedRecursive)
Expand All @@ -158,8 +158,8 @@ func convertLibcontainerStats(ls *libcontainer.Stats) *types.Stats {
s.Blkio.IoMergedRecursive = convertBlkioEntry(cg.BlkioStats.IoMergedRecursive)
s.Blkio.IoTimeRecursive = convertBlkioEntry(cg.BlkioStats.IoTimeRecursive)
s.Blkio.SectorsRecursive = convertBlkioEntry(cg.BlkioStats.SectorsRecursive)
convertPSI(&cg.BlkioStats.PSI.Some, &s.Blkio.PSI.Some)
convertPSI(&cg.BlkioStats.PSI.Full, &s.Blkio.PSI.Full)
convertPSI(cg.BlkioStats.PSI.Some, s.Blkio.PSI.Some)
convertPSI(cg.BlkioStats.PSI.Full, s.Blkio.PSI.Full)

s.Hugetlb = make(map[string]types.Hugetlb)
for k, v := range cg.HugetlbStats {
Expand Down

0 comments on commit 145c93e

Please sign in to comment.