mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
AWS Kinesis GetRecords documents MillisBehindLatest as the time delta between the consumer position and the shard tip in milliseconds. Floci was returning the count of records remaining in the shard instead, so downstream iterator-age metrics and lag-based alerting were wrong (e.g. 10 records ahead surfaced as 10ms of lag). Use the ApproximateArrivalTimestamp already stamped at PutRecord time to compute the delta. Returns 0 when the consumer is at the shard tip, the shard is empty, or no records were returned.