Fix burrow_group.offset calculation for Burrow plugin (#4584)

This commit is contained in:
rbrendler
2018-08-23 15:30:59 -05:00
committed by Daniel Nelson
parent 36959abce9
commit 16a6feda4a
3 changed files with 7 additions and 7 deletions

View File

@@ -397,13 +397,11 @@ func (b *burrow) genGroupStatusMetrics(r *apiResponse, cluster, group string, ac
partitionCount = len(r.Status.Partitions)
}
// get max timestamp and offset from partitions list
// get max timestamp and total offset from partitions list
offset := int64(0)
timestamp := int64(0)
for _, partition := range r.Status.Partitions {
if partition.End.Offset > offset {
offset = partition.End.Offset
}
offset += partition.End.Offset
if partition.End.Timestamp > timestamp {
timestamp = partition.End.Timestamp
}