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

Define lag as int #196

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fink_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "8.1"
__version__ = "8.2"
__schema_version__ = "distribution_schema_fink_ztf_{}.avsc"
10 changes: 6 additions & 4 deletions fink_client/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,21 +371,23 @@ def return_offsets(
offset = "%d" % (partition.offset)

if hi < 0:
lag = "no hwmark" # Unlikely
lag = 0 # Unlikely
elif partition.offset < 0:
# No committed offset, show total message count as lag.
# The actual message count may be lower due to compaction
# and record deletions.
lag = "%d" % (hi - lo)
lag = hi - lo
partition.offset = 0
else:
lag = "%d" % (hi - partition.offset)
lag = hi - partition.offset
#
total_offsets = total_offsets + partition.offset
total_lag = total_lag + int(lag)

if verbose:
if (hide_empty_partition and offset != "-") or (not hide_empty_partition):
if (hide_empty_partition and (offset != "-" or int(lag) > 0)) or (
not hide_empty_partition
):
print(
"%-50s %9s %9s"
% (
Expand Down
Loading