ui.clusters.resourcesInspect.ftl Maven / Gradle / Ivy
<#-- @ftlvariable name="tableTitle" type="java.lang.String" -->
<#-- @ftlvariable name="clusterResources" type="com.infobip.kafkistry.service.resources.ClusterDiskUsage" -->
<#-- @ftlvariable name="diffModeEnabled" type="java.lang.Boolean" -->
<#-- @ftlvariable name="collapseEnabled" type="java.lang.Boolean" -->
<#-- @ftlvariable name="collapseId" type="java.lang.String" -->
<#import "../common/util.ftl" as util>
<#import "../common/infoIcon.ftl" as info>
<#assign hasOrphaned = clusterResources.combined.usage.orphanedReplicasCount gt 0>
<#assign showReplicas = !hasOrphaned>
<#assign collapseEnabled = (collapseEnabled!false)>
<#function signClass number usageLevelClass="">
<#-- @ftlvariable name="number" type="java.lang.Number" -->
<#-- @ftlvariable name="usageLevelClass" type="java.lang.String" -->
<#if !(diffModeEnabled??) || !diffModeEnabled>
<#return "">
#if>
<#if number gt 0>
<#if usageLevelClass?contains("bg-danger")>
<#-- workaround case when we have inclease and highest bg-danger, text would then be the same as background -->
<#return "text-warning font-weight-bold">
<#else>
<#return "text-danger font-weight-bold">
#if>
<#elseif number lt 0>
<#return "text-success font-weight-bold">
<#else>
<#return "">
#if>
#function>
<#assign hasTitle = tableTitle?? && tableTitle != "">
<#if hasTitle>
${tableTitle}
<#else>
Broker
#if>
Disk capacity
Total used
<#assign totalDoc>
Actual disk total usage of topic's replica log dirs.
#assign>
<@info.icon tooltip = totalDoc/>
Possible usage
<#assign boundedDoc>
Possible usage of disk if all topics would reach their
configured retention.bytes
limit
#assign>
<@info.icon tooltip = boundedDoc/>
Unbounded used
<#assign unboundedDoc>
Current usage of disk for all topics that have unbounded size retention
retention.bytes
= -1
limit
#assign>
<@info.icon tooltip = unboundedDoc/>
<#if hasOrphaned>
Orphaned used
<#assign orphanedDoc>
Replica dirs that exist on broker but not currently being part of topic's assignment.
#assign>
<@info.icon tooltip = orphanedDoc/>
#if>
<#if hasTitle>
Broker
#if>
Total
Free
Bytes
% capacity
<#if showReplicas>
Replicas
#if>
Bytes
% capacity
<#if showReplicas>
Replicas
#if>
Bytes
% used
<#if showReplicas>
Replicas
#if>
<#if hasOrphaned>
Bytes
Replicas
#if>
<#macro diskUsages broker, disk, worstCurrentUsageLevel="NONE", worstPossibleUsageLevel="NONE">
<#-- @ftlvariable name="disk" type="com.infobip.kafkistry.service.resources.BrokerDisk" -->
<#-- @ftlvariable name="worstCurrentUsageLevel" type="com.infobip.kafkistry.service.resources.UsageLevel" -->
<#-- @ftlvariable name="worstPossibleUsageLevel" type="com.infobip.kafkistry.service.resources.UsageLevel" -->
<#assign usages = disk.usage>
${broker}
<#if collapseEnabled && broker == "ALL">
▼
△
#if>
<#if usages.totalCapacityBytes??>
${util.prettyDataSize(usages.totalCapacityBytes, diffModeEnabled!false)}
<#else>
---
#if>
<#if usages.freeCapacityBytes??>
${util.prettyDataSize(usages.freeCapacityBytes, diffModeEnabled!false)}
<#else>
---
#if>
<#assign currentUsageLevel = (worstCurrentUsageLevel == "NONE")?then(disk.portions.usageLevel, worstCurrentUsageLevel)>
<#assign usageLevelClass = util.usageLevelToHtmlClass(currentUsageLevel)>
<#if usages.totalUsedBytes??>
${util.prettyDataSize(usages.totalUsedBytes, diffModeEnabled!false)}
<#else>
---
#if>
<#if disk.portions.usedPercentOfCapacity??>
${util.prettyNumber(disk.portions.usedPercentOfCapacity, diffModeEnabled!false)}%
<#else>
---
#if>
<#if showReplicas>
<#if usages.replicasCount??>
${util.numberToString(usages.replicasCount, diffModeEnabled!false)}
<#else>
---
#if>
#if>
<#assign possibleUsageLevel = (worstPossibleUsageLevel == "NONE")?then(disk.portions.possibleUsageLevel, worstPossibleUsageLevel)>
<#assign possibleUsageLevelClass = util.usageLevelToHtmlClass(possibleUsageLevel)>
${util.prettyDataSize(usages.boundedSizePossibleUsedBytes, diffModeEnabled!false)}
<#if disk.portions.possibleUsedPercentOfCapacity??>
${util.prettyNumber(disk.portions.possibleUsedPercentOfCapacity, diffModeEnabled!false)}%
<#else>
---
#if>
<#if showReplicas>
${util.numberToString(usages.boundedReplicasCount, diffModeEnabled!false)}
#if>
${util.prettyDataSize(usages.unboundedSizeUsedBytes)}
<#if disk.portions.unboundedUsedPercentOfTotalUsed??>
${util.prettyNumber(disk.portions.unboundedUsedPercentOfTotalUsed, diffModeEnabled!false)}%
<#else>
---
#if>
<#if showReplicas>
${util.numberToString(usages.unboundedReplicasCount, diffModeEnabled!false)}
#if>
<#if hasOrphaned>
${util.prettyDataSize(usages.orphanedReplicasSizeUsedBytes, diffModeEnabled!false)}
${util.numberToString(usages.orphanedReplicasCount, diffModeEnabled!false)}
#if>
#macro>
class="collapsed" data-target=".broker-resources-row.collapse-${collapseId}" data-toggle="collapsing"#if>>
<@diskUsages broker="ALL" disk=clusterResources.combined
worstCurrentUsageLevel=clusterResources.worstCurrentUsageLevel
worstPossibleUsageLevel=clusterResources.worstPossibleUsageLevel
/>
<#list clusterResources.brokerUsages as brokerId, brokerUsages>
<@diskUsages broker="${brokerId}" disk = brokerUsages/>
#list>