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

ui.clusters.resourcesInspect.ftl Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
<#-- @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 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">
        
    <#elseif number lt 0>
        <#return "text-success font-weight-bold">
    <#else>
        <#return "">
    



        <#assign hasTitle = tableTitle?? && tableTitle != "">
        <#if hasTitle>
            
        <#else>
            
        <#if hasOrphaned>
            
        <#if hasTitle>
            
        <#if showReplicas>
            
        <#if showReplicas>
            
        <#if showReplicas>
            

        <#if hasOrphaned>
            
    <#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>
        

        <#assign currentUsageLevel = (worstCurrentUsageLevel == "NONE")?then(disk.portions.usageLevel, worstCurrentUsageLevel)>
        <#assign usageLevelClass = util.usageLevelToHtmlClass(currentUsageLevel)>
        
        <#if showReplicas>
            

        <#assign possibleUsageLevel = (worstPossibleUsageLevel == "NONE")?then(disk.portions.possibleUsageLevel, worstPossibleUsageLevel)>
        <#assign possibleUsageLevelClass = util.usageLevelToHtmlClass(possibleUsageLevel)>
        
        <#if showReplicas>
            
        <#if showReplicas>
            

        <#if hasOrphaned>
            class="collapsed" data-target=".broker-resources-row.collapse-${collapseId}" data-toggle="collapsing">
        <@diskUsages broker="ALL" disk=clusterResources.combined
            worstCurrentUsageLevel=clusterResources.worstCurrentUsageLevel
            worstPossibleUsageLevel=clusterResources.worstPossibleUsageLevel
        />
    
    <#list clusterResources.brokerUsages as brokerId, brokerUsages>
        
            <@diskUsages broker="${brokerId}" disk = brokerUsages/>
        
${tableTitle}Broker Disk capacity Total used <#assign totalDoc> Actual disk total usage of topic's replica log dirs. <@info.icon tooltip = totalDoc/> Possible usage <#assign boundedDoc> Possible usage of disk if all topics would reach their configured retention.bytes limit <@info.icon tooltip = boundedDoc/> Unbounded used <#assign unboundedDoc> Current usage of disk for all topics that have unbounded size retention retention.bytes = -1 limit <@info.icon tooltip = unboundedDoc/> Orphaned used <#assign orphanedDoc> Replica dirs that exist on broker but not currently being part of topic's assignment. <@info.icon tooltip = orphanedDoc/>
Broker Total Free Bytes % capacityReplicas Bytes % capacityReplicas Bytes % usedReplicas Bytes Replicas
${broker} <#if collapseEnabled && broker == "ALL"> <#if usages.totalCapacityBytes??> ${util.prettyDataSize(usages.totalCapacityBytes, diffModeEnabled!false)} <#else> --- <#if usages.freeCapacityBytes??> ${util.prettyDataSize(usages.freeCapacityBytes, diffModeEnabled!false)} <#else> --- <#if usages.totalUsedBytes??> ${util.prettyDataSize(usages.totalUsedBytes, diffModeEnabled!false)} <#else> --- <#if disk.portions.usedPercentOfCapacity??> ${util.prettyNumber(disk.portions.usedPercentOfCapacity, diffModeEnabled!false)}% <#else> --- <#if usages.replicasCount??> ${util.numberToString(usages.replicasCount, diffModeEnabled!false)} <#else> --- ${util.prettyDataSize(usages.boundedSizePossibleUsedBytes, diffModeEnabled!false)} <#if disk.portions.possibleUsedPercentOfCapacity??> ${util.prettyNumber(disk.portions.possibleUsedPercentOfCapacity, diffModeEnabled!false)}% <#else> --- ${util.numberToString(usages.boundedReplicasCount, diffModeEnabled!false)} ${util.prettyDataSize(usages.unboundedSizeUsedBytes)} <#if disk.portions.unboundedUsedPercentOfTotalUsed??> ${util.prettyNumber(disk.portions.unboundedUsedPercentOfTotalUsed, diffModeEnabled!false)}% <#else> --- ${util.numberToString(usages.unboundedReplicasCount, diffModeEnabled!false)} ${util.prettyDataSize(usages.orphanedReplicasSizeUsedBytes, diffModeEnabled!false)} ${util.numberToString(usages.orphanedReplicasCount, diffModeEnabled!false)}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy