ui.consume.partitionReadStats.ftl Maven / Gradle / Ivy
<#-- @ftlvariable name="partitionsStats" type="java.util.Map" -->
<#import "../common/util.ftl" as util>
<#import "progressBar.ftl" as pb>
Partition
Processed offsets
Processed
Accepted
Reached end
<#list partitionsStats as partition, partitionStatus>
<#macro prettyPercentage value zeroDivDefault partitionStatus>
<#assign partitionSize = partitionStatus.endOffset - partitionStatus.beginOffset>
<#if partitionSize <= 0>
<#assign percentage = "${zeroDivDefault}%">
<#else>
<#assign percentage = "${util.prettyNumber(100.0 * value / partitionSize)}%">
#if>
(${percentage})
#macro>
<#macro offsetPercentage offset zeroDivDefault partitionStatus>
<#assign fromBegin = offset - partitionStatus.beginOffset>
<@prettyPercentage value=fromBegin zeroDivDefault=zeroDivDefault partitionStatus=partitionStatus/>
#macro>
${partition}
${partitionStatus.startedAtOffset}
<@offsetPercentage offset=partitionStatus.startedAtOffset zeroDivDefault=0.0 partitionStatus=partitionStatus/>
<#if partitionStatus.startedAtTimestamp??>
#if>
→
${partitionStatus.endedAtOffset}
<@offsetPercentage offset=partitionStatus.endedAtOffset zeroDivDefault=100.0 partitionStatus=partitionStatus/>
<#if partitionStatus.endedAtTimestamp??>
#if>
${partitionStatus.read}
<@prettyPercentage value=partitionStatus.read zeroDivDefault=0.0 partitionStatus=partitionStatus/>
<#if partitionStatus.startedAtTimestamp?? && partitionStatus.endedAtTimestamp??>
<#assign timeRange = partitionStatus.endedAtTimestamp - partitionStatus.startedAtTimestamp>
${util.prettyDuration(timeRange/1000.0)}
#if>
${partitionStatus.matching}
<#if partitionStatus.reachedEnd>
YES
<#else>
NO
#if>
<#if partitionStatus.remaining gt 0>
${partitionStatus.remaining}
<@prettyPercentage value=partitionStatus.remaining zeroDivDefault=0.0 partitionStatus=partitionStatus/>
#if>
<#assign skip = partitionStatus.startedAtOffset-partitionStatus.beginOffset>
<#assign preRetention = 0>
<#if skip lt 0>
<#assign preRetention = -skip>
<#assign skip = 0>
#if>
<#assign read = partitionStatus.read>
<#assign remain = partitionStatus.remaining>
<#assign totalSum = preRetention + skip + read + remain>
<@pb.progressBar total=totalSum preRetention=preRetention skip=skip read=read remain=remain/>
#list>