mtesseract / nakadi-client

Haskell Client Library for the Nakadi Event Broker
Other
13 stars 9 forks source link

Support time lag retrieval for subscription stats #98

Closed mtesseract closed 6 years ago

mtesseract commented 6 years ago

This fixes the per-subscription statistics retrieval and implements support for the new show_time_lag parameter of the Nakadi API.

The statistics retrieval never worked before, thus I felt free to improve the general API in this regard.

In particular I have renamed the type SubscriptionEventTypeStatsResult to SubscriptionStats — the Nakadi Swagger does not contain a specific name for this object type.

There is some reformatting being done by brittany, sorry for the noise. I have tested the API call manually, but a test should be added.

I wouldn't mind merging this right away, though.

etorreborre commented 6 years ago

👍

mtesseract commented 6 years ago

As discussed, I have added the setShowTimeLag function and simplified the subscriptionStats API.

When I compared our model for PartitionStat with the Nakadi API (https://nakadi.io/manual.html#definition_SubscriptionEventTypeStats), I have noticed that we wrongly regarded stream_id and unconsumed_events as mandatory. I have fixed this.

I am currently trying out the Haskell IDE Engine (HIE), it comes bundled with brittany integration (https://github.com/lspitzner/brittany), which has sadly added quite some formatting noise, sorry for that.

I have also added missing tests for subscriptionStats.

Ok to merge?

etorreborre commented 6 years ago

👍 ok to merge but I think that one test could be improved.

etorreborre commented 6 years ago

👍