All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ui.consume.records.ftl Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
<#-- @ftlvariable name="recordsResult" type="com.infobip.kafkistry.service.consume.KafkaRecordsResult" -->
<#-- @ftlvariable name="overallSkipCount" type="java.lang.Long" -->
<#-- @ftlvariable name="overallReadCount" type="java.lang.Long" -->
<#-- @ftlvariable name="overallPartitions" type="java.util.Map" -->
<#-- @ftlvariable name="json" type="com.fasterxml.jackson.databind.ObjectMapper" -->

<#import "../common/util.ftl" as util>
<#import "progressBar.ftl" as pb>

<#assign records = recordsResult.records>

<#if overallPartitions??>
    <#assign totalReadCount = overallReadCount>
    <#assign totalSkipCount = overallSkipCount>
    <#assign partitionsStats = overallPartitions>
<#else>
    <#assign partitionsStats = recordsResult.partitions>
    <#assign totalSkipCount = recordsResult.skipCount>
    <#assign totalReadCount = recordsResult.readCount>


<#assign statusMessages = []>
<#if records?size == 0>
    <#assign msgAlertClass = "alert-warning">
    <#assign statusMessages += ["No records received"]>
<#else>
    <#assign msgAlertClass = "alert-primary">
    <#assign statusMessages += ["Got ${records?size} record(s)"]>


<#assign statusMessages += ["Read iteration processed ${recordsResult.readCount} record(s)"]>
<#if recordsResult.totalRecordsCount == 0>
    <#assign statusMessages += ["Processed no record(s), topic is empty"]>
<#else>
    <#assign statusMessages += ["Processed ${totalReadCount} record(s), ${util.prettyNumber(100.0*totalReadCount/recordsResult.totalRecordsCount)}% of ${recordsResult.totalRecordsCount} total records in topic partition(s)"]>
    <#if totalSkipCount gt 0>
        <#assign statusMessages += ["Skipped first ${totalSkipCount} record(s) (${util.prettyNumber(100.0*totalSkipCount/recordsResult.totalRecordsCount)}% of total in partitions) due to 'Read starting from' options"]>
    
    <#if recordsResult.remainingCount gt 0>
        <#assign statusMessages += ["Remaining ${recordsResult.remainingCount} record(s) (${util.prettyNumber(100.0*recordsResult.remainingCount/recordsResult.totalRecordsCount)}% of total in partitions) to reach end "]>
    


<#assign preRetention = 0>
<#list partitionsStats as partition, partitionStatus>
    <#assign skip = partitionStatus.startedAtOffset-partitionStatus.beginOffset>
    <#if skip lt 0>
        <#assign preRetention += -skip>
    

<#if preRetention gt 0>
    <#assign statusMessages += ["${preRetention} record(s) have been processed, but now were deleted by retention on topic"]>


<#if recordsResult.timedOut>
    <#assign statusMessages += ["Wait has timed out"]>

<#if recordsResult.reachedEnd>
    <#assign statusMessages += ["Reading reached latest"]>






Read status:
    <#list statusMessages as msg>
  • ${msg}
<#assign totalSum = preRetention + totalSkipCount + totalReadCount + recordsResult.remainingCount> <@pb.progressBar total=totalSum preRetention=preRetention skip=totalSkipCount read=totalReadCount remain=recordsResult.remainingCount emHeight=2 legend=true/>
<#include "partitionReadStats.ftl">


<#list records as record>
Record ${record?index+1} of ${records?size}
Key:
<#assign kafkaValue = record.key> <#include "kafkaValue.ftl">
Headers:
<#if record.headers?size == 0> (none) <#else>
Value:
<#assign kafkaValue = record.value> <#include "kafkaValue.ftl">





© 2015 - 2024 Weber Informatics LLC | Privacy Policy