Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group displays incorrect lag #62

Closed
fgeller opened this issue Jul 31, 2017 · 0 comments
Closed

group displays incorrect lag #62

fgeller opened this issue Jul 31, 2017 · 0 comments

Comments

@fgeller
Copy link
Owner

fgeller commented Jul 31, 2017

when offset is sarama.OffsetNewest (-1), the lag is computed incorrectly:

resolve(sarama.OffsetNewest) - offset
= resolve(sarama.OffsetNewest) - sarama.OffsetNewest
= resolve(sarama.OffsetNewest) - (-1)
= resolve(sarama.OffsetNewest) + 1
@fgeller fgeller closed this as completed in 3dd2a24 Aug 4, 2017
fgeller added a commit that referenced this issue Aug 4, 2017
* don't display sarama.OffsetNewest / sarama.OffsetOldest values. instead,
  display `null`. displaying -1/-2 led to incorrect lag calculation #62 and
  confusion when reading the results. i hope `null` is more explicit in that no
  offset has been marked for this topic/group/partition combination.

* don't display a result when no offset has been marked. instead display
  `null`. cf #62

* change result output structure from:
  {"name": "grp", "topic": "news", "offsets": {"1": {"offset": 2, "lag": 23}}}
  to
  {"name": "grp", "topic": "news", "offsets": [{"partition": 1, "offset": 2, "lag": 23}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant