Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

Commit

Permalink
Force lag to -1 when offset is equal to -1 ISSUES #14
Browse files Browse the repository at this point in the history
  • Loading branch information
sundy-li committed Feb 26, 2019
1 parent e603490 commit c2bacbc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions monitor/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ func (i *Importer) start() {
"offsize": entry.Offset,
"lag": entry.Logsize - entry.Offset,
}
if entry.Offset < 0 {
fields["lag"] = -1
}

tm := time.Unix(msg.Timestamp/1000, 0)
pt, err := client.NewPoint("consumer_metrics", tags, fields, tm)
Expand Down

0 comments on commit c2bacbc

Please sign in to comment.