Skip to content

Commit

Permalink
fixing container state merge
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysied committed Apr 16, 2020
1 parent 7a43f9d commit 711f25f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ func (a *AggregateContainerState) MergeContainerState(other *AggregateContainerS
a.AggregateCPUUsage.Merge(other.AggregateCPUUsage)
a.AggregateMemoryPeaks.Merge(other.AggregateMemoryPeaks)

if !other.FirstSampleStart.IsZero() && other.FirstSampleStart.Before(a.FirstSampleStart) {
if a.FirstSampleStart.IsZero() ||
(!other.FirstSampleStart.IsZero() && other.FirstSampleStart.Before(a.FirstSampleStart)) {
a.FirstSampleStart = other.FirstSampleStart
}
if other.LastSampleStart.After(a.LastSampleStart) {
Expand Down

0 comments on commit 711f25f

Please sign in to comment.