flipp-oss / deimos

Framework to work with Kafka, Avro and ActiveRecord
Other
59 stars 22 forks source link

Recalculate lag on heartbeat #61

Closed DeeChau closed 4 years ago

DeeChau commented 4 years ago

Pull Request Template

Description

Fixes #4, introduces partition_last_offsets that is used to recalculate consumer lag on heartbeat.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

DeeChau commented 4 years ago

Revisited the way lag is calculated, For the following ActiveSupport::Notifications used for this operation,

to measure the last known offset for certain partitions upon message_processed

Use this current offset in each heartbeat operation and get the partitions last offset for the topic to calculate the lag.

dorner commented 4 years ago

It's a lot easier to follow now - good work!