You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/statsutil/stats.go
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -69,15 +69,20 @@ type ContainerStats struct {
69
69
}
70
70
71
71
// NewStats is from https://github.com/docker/cli/blob/3fb4fb83dfb5db0c0753a8316f21aea54dab32c5/cli/command/container/formatter_stats.go#L113-L116
// SetStatistics is from https://github.com/docker/cli/blob/3fb4fb83dfb5db0c0753a8316f21aea54dab32c5/cli/command/container/formatter_stats.go#L87-L93
77
77
func (cs*Stats) SetStatistics(sStatsEntry) {
78
78
cs.mutex.Lock()
79
79
defercs.mutex.Unlock()
80
+
// The statsEntry ID and Name fields are already populated within the cs.StatsEntry
81
+
cStatsName:=cs.StatsEntry.Name
82
+
cStatsID:=cs.StatsEntry.ID
80
83
cs.StatsEntry=s
84
+
cs.StatsEntry.Name=cStatsName
85
+
cs.StatsEntry.ID=cStatsID
81
86
}
82
87
83
88
// GetStatistics is from https://github.com/docker/cli/blob/3fb4fb83dfb5db0c0753a8316f21aea54dab32c5/cli/command/container/formatter_stats.go#L95-L100
0 commit comments