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

ui.recordsStructure.structureElements.ftl Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
<#-- @ftlvariable name="json" type="com.fasterxml.jackson.databind.ObjectMapper" -->

<#import "../common/infoIcon.ftl" as info>

<#assign collapseIdGen = 1>
<#function nextCollapseId>
    <#assign collapseId = collapseIdGen>
    <#assign collapseIdGen = collapseIdGen + 1>
    <#return "collapse-${collapseId}">


<#macro showFieldValue fieldValue>
<#-- @ftlvariable name="fieldValue" type="com.infobip.kafkistry.model.RecordFieldValue" -->
    
        Values:
        <#if fieldValue.highCardinality>
            HIGH CARDINALITY
        <#elseif fieldValue.tooBig>
            TOO BIG
        <#elseif fieldValue.valueSet??>
            [
            <#list fieldValue.valueSet as val>
                <#assign valAsString>
                    <#attempt>
                        <#if val?is_boolean>${val?then('true', 'false')}
                        <#elseif val?is_number>${val?c}
                        <#elseif val?is_string>${val}
                        <#else>${val?api.toString()}
                        <#recover>
                            ???
                    
                
                ${valAsString}<#if !val?is_last>,
            
            ]
        
    


<#macro showFieldInfo field parentType="" fullName=false>
<#-- @ftlvariable name="field" type="com.infobip.kafkistry.model.RecordField" -->
    
        ${field.type}
    
    <#if fullName>
        <#if (field.fullName)??>
            ${field.fullName}
        <#else>
            ROOT
        
        <#if field.nullable>
            NULLABLE
        
    <#else>
        <#if field.nullable>
            NULLABLE
        
        <#if (field.name)??>
            ${field.name}
        <#else>
            <#assign name>
                <#switch parentType>
                    <#case "OBJECT">*<#break>
                    <#case "ARRAY">[*]<#break>
                    <#default>
                
            
            <#if name?has_content>
                ${name} (variable)
            
        
    
    <#if field.value??>
        <@showFieldValue fieldValue=field.value/>
    


<#macro showRecordField field parentType>
<#-- @ftlvariable name="field" type="com.infobip.kafkistry.model.RecordField" -->
<#-- @ftlvariable name="parentType" type="com.infobip.kafkistry.model.RecordFieldType" -->
    <#assign hasChildren = (field.children)?? && field.children?size gt 0>
    
<@showFieldInfo field=field parentType=parentType/> <#if hasChildren>
<#assign collapseTarget = nextCollapseId()>
<#list field.children as childField> <@showRecordField field=childField parentType=field.type/>
<#function fieldsFlat jsonFields> <#-- @ftlvariable name="jsonFields" type="java.util.List" --> <#assign fields = []> <#list jsonFields as f> <#assign fields += [f] + ((f.children)??)?then(fieldsFlat(f.children), [])> <#return fields> <#macro showSizeStat stat> <#-- @ftlvariable name="stat" type="com.infobip.kafkistry.model.SizeStatistic" --> <#assign tooltip>
# samples${stat.count}
Avg${stat.avg} bytes
Min${stat.min} bytes
Max${stat.max} bytes
${stat.avg} <@info.icon tooltip=tooltip/> <#macro showRecordSize size> <#-- @ftlvariable name="size" type="com.infobip.kafkistry.model.RecordSize" -->
15 Min 1 Hour 6 Hours Day Week Month
Msg Total <#if (size.msg.last15Min)??><@showSizeStat stat=size.msg.last15Min/><#else>--- <#if (size.msg.lastHour)??><@showSizeStat stat=size.msg.lastHour/><#else>--- <#if (size.msg.last6Hours)??><@showSizeStat stat=size.msg.last6Hours/><#else>--- <#if (size.msg.lastDay)??><@showSizeStat stat=size.msg.lastDay/><#else>--- <#if (size.msg.lastWeek)??><@showSizeStat stat=size.msg.lastWeek/><#else>--- <#if (size.msg.lastMonth)??><@showSizeStat stat=size.msg.lastMonth/><#else>---
Key <#if (size.key.last15Min)??><@showSizeStat stat=size.key.last15Min/><#else>--- <#if (size.key.lastHour)??><@showSizeStat stat=size.key.lastHour/><#else>--- <#if (size.key.last6Hours)??><@showSizeStat stat=size.key.last6Hours/><#else>--- <#if (size.key.lastDay)??><@showSizeStat stat=size.key.lastDay/><#else>--- <#if (size.key.lastWeek)??><@showSizeStat stat=size.key.lastWeek/><#else>--- <#if (size.key.lastMonth)??><@showSizeStat stat=size.key.lastMonth/><#else>---
Value <#if (size.value.last15Min)??><@showSizeStat stat=size.value.last15Min/><#else>--- <#if (size.value.lastHour)??><@showSizeStat stat=size.value.lastHour/><#else>--- <#if (size.value.last6Hours)??><@showSizeStat stat=size.value.last6Hours/><#else>--- <#if (size.value.lastDay)??><@showSizeStat stat=size.value.lastDay/><#else>--- <#if (size.value.lastWeek)??><@showSizeStat stat=size.value.lastWeek/><#else>--- <#if (size.value.lastMonth)??><@showSizeStat stat=size.value.lastMonth/><#else>---
Headers <#if (size.headers.last15Min)??><@showSizeStat stat=size.headers.last15Min/><#else>--- <#if (size.headers.lastHour)??><@showSizeStat stat=size.headers.lastHour/><#else>--- <#if (size.headers.last6Hours)??><@showSizeStat stat=size.headers.last6Hours/><#else>--- <#if (size.headers.lastDay)??><@showSizeStat stat=size.headers.lastDay/><#else>--- <#if (size.headers.lastWeek)??><@showSizeStat stat=size.headers.lastWeek/><#else>--- <#if (size.headers.lastMonth)??><@showSizeStat stat=size.headers.lastMonth/><#else>---
<#macro showPayloadStructure structure> <#-- @ftlvariable name="structure" type="com.infobip.kafkistry.model.RecordsStructure" -->
Record root structure type: ${structure.payloadType} <#if structure.nullable> NULLABLE <#if (structure.jsonFields)??>
<#macro showStructure structure> <#-- @ftlvariable name="structure" type="com.infobip.kafkistry.model.RecordsStructure" -->
Sizes
<@showRecordSize size=structure.size/>

Headers
<#if structure.headerFields?? && structure.headerFields?size gt 0 && structure.headerFields?first.children?size gt 0> <#list structure.headerFields?first.children as headerField> <@showRecordField field=headerField parentType=""/> <#else> (no headers)

Inferred structure
<@showPayloadStructure structure=structure/>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy