ui.topics.partitionStats.ftl Maven / Gradle / Ivy
<#-- @ftlvariable name="topicName" type="java.lang.String" -->
<#-- @ftlvariable name="clusterIdentifier" type="java.lang.String" -->
<#-- @ftlvariable name="topicStatus" type="com.infobip.kafkistry.service.topic.TopicClusterStatus" -->
<#-- @ftlvariable name="topicOffsets" type="com.infobip.kafkistry.service.topic.offsets.TopicOffsets" -->
<#-- @ftlvariable name="topicReplicas" type="com.infobip.kafkistry.kafkastate.TopicReplicaInfos" -->
<#-- @ftlvariable name="topicStatus" type="com.infobip.kafkistry.service.topic.TopicClusterStatus" -->
<#import "../common/util.ftl" as _util>
<#import "../common/infoIcon.ftl" as _info_>
<#import "../sql/sqlQueries.ftl" as sql>
<#assign retentionMs = (topicStatus.existingTopicInfo.config["retention.ms"].value?number)!-1>
<#assign retentionBytes = (topicStatus.existingTopicInfo.config["retention.bytes"].value?number)!-1>
Partition stats
<@sql.topicProduceRates cluster=clusterIdentifier topic=topicName/>
<@sql.topicSizeVsTimeRetention cluster=clusterIdentifier topic=topicName/>
Partition
Brokers
Messages <#include "numMessagesEstimateDoc.ftl">
Produce rate
Replica size
% of retention.bytes
Oldest record age
% of retention.ms
<#assign partitions = (topicOffsets.partitionsOffsets?keys)!(topicReplicas.partitionBrokerReplicas?keys)!(oldestRecordAges?keys)![]>
<#assign lowProvisionPartitions = (topicStatus.externInspectInfo["com.infobip.kafkistry.service.topic.inspectors.TopicUnderprovisionedRetentionInspector"])!{}>
<#-- @ftlvariable name="lowProvisionPartitions" type="java.util.Map" -->
<#assign unevenRatePartitions = (topicStatus.externInspectInfo["com.infobip.kafkistry.service.topic.inspectors.TopicUnevenPartitionProducingInspector"])!{}>
<#-- @ftlvariable name="unevenRatePartitions" type="java.util.Map" -->
<#list partitions?sort as partition>
<#-- Partition -->
${partition?c}
<#-- Brokers -->
<#if (topicStatus.existingTopicInfo.partitionsAssignments)??>
<#list topicStatus.existingTopicInfo.partitionsAssignments as assignment>
<#if assignment.partition == partition>
<#list assignment.replicasAssignments as replica>
${replica.brokerId?c}<#if !replica?is_last>,#if>
#list>
#if>
#list>
<#else>
---
#if>
<#-- Messages -->
<#if (topicOffsets.partitionsOffsets?api.get(partition))??>
<#assign offsets = topicOffsets.partitionsOffsets?api.get(partition)>
${_util.prettyNumber(offsets.end - offsets.begin)}
<#assign offsetTooltip>
Begin: ${offsets.begin?c}
End: ${offsets.end?c}
#assign>
<@_info_.icon tooltip=offsetTooltip/>
<#else>
---
#if>
<#if (topicOffsets.partitionMessageRate?api.get(partition).upTo15MinRate)??>
<#assign rateMsgPerSec = topicOffsets.partitionMessageRate?api.get(partition).upTo15MinRate>
<#assign lowRate = false>
<#assign highRate = false>
<#if unevenRatePartitions?size gt 0>
<#assign lowRate = (unevenRatePartitions.lowRate?api.get(partition))??>
<#assign highRate = (unevenRatePartitions.highRate?api.get(partition))??>
#if>
<#-- Produce rate -->
${_util.prettyNumber(rateMsgPerSec)} msg/sec
<#if highRate>
<@_info_.icon tooltip="This is a high produce rate partition"/>
#if>
<#if lowRate>
<@_info_.icon tooltip="This is a low produce rate partition"/>
#if>
<#else>
--- <#-- Produce rate -->
#if>
<#if (topicReplicas.partitionBrokerReplicas?api.get(partition))??>
<#assign partitionBrokerReplicas = topicReplicas.partitionBrokerReplicas?api.get(partition)>
<#assign sizeBytes = 0>
<#list partitionBrokerReplicas as broker, replica>
<#assign sizeBytes = (replica.sizeBytes gt sizeBytes)?then(replica.sizeBytes, sizeBytes)>
#list>
<#-- Replica size -->
${_util.prettyDataSize(sizeBytes)}
<#if retentionBytes gt 0>
<#-- % of retention.bytes -->
${_util.prettyNumber(100*sizeBytes/retentionBytes)} %
<#else>
<#-- % of retention.bytes -->
---
#if>
<#else>
--- <#-- Replica size -->
--- <#-- % of retention.bytes -->
#if>
<#if (oldestRecordAges?api.get(partition))??>
<#assign ageMs = oldestRecordAges?api.get(partition)>
<#assign underprovisioned = false>
<#if lowProvisionPartitions?size gt 0>
<#assign underprovisioned = (lowProvisionPartitions?api.get(partition))??>
#if>
<#-- Oldest record age -->
${_util.prettyDuration(ageMs / 1000)}
<#if underprovisioned>
<#assign underprovisionTooltip>
This partition has lower effective retention than wanted
retention.ms
due to low retention.bytes
#assign>
<@_info_.icon tooltip=underprovisionTooltip/>
#if>
<#if retentionMs gt 0>
<#-- % of retention.ms -->
${_util.prettyNumber(100*ageMs/retentionMs)} %
<#else>
--- <#-- % of retention.ms -->
#if>
<#else>
<#assign oldestDisabledDoc>
Sampling of oldest records timestamps is disabled
Enable it by setting one of following application properties:
OLDEST_RECORD_AGE_ENABLED
= true
app.oldest-record-age.enabled
= true
#assign>
<#assign oldestDisabledCell>
DISABLED
<@_info_.icon tooltip=oldestDisabledDoc/>
#assign>
<#if oldestRecordAgesDisabled>
${oldestDisabledCell} <#-- Oldest record age -->
${oldestDisabledCell} <#-- % of retention.ms -->
<#else>
--- <#-- Oldest record age -->
--- <#-- % of retention.ms -->
#if>
#if>
#list>