traceInfo.ftl 10.9 KB
Newer Older
A
ascrutae 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<#macro traceTableTmpl>
<script type="text/x-jsrender" id="traceTreeTableTmpl">
        <table id="traceTreeTable">
            <thead>
            <tr>
                <th style="width: 25%" >服务名</th>
                <th style="width: 5%">类型</th>
                <th style="width: 5%">状态</th>
                <th style="width: 20%">服务/方法</th>
                <th style="width: 15%">主机信息</th>
                <th style="width: 30%">时间轴</th>
            </tr>
            </thead>
            <tbody>
                {{for treeNodes}}
                    <tr name='log' statusCodeStr="{{>statusCodeStr}}" data-tt-id='{{>colId}}'
                    {{if !isEntryNode }}data-tt-parent-id='{{>parentLevel}}'{{/if}}
                     >
                        <td><b>{{>applicationIdStr}}</b></td>
                        <td>{{>spanTypeName}}</td>
                        <td>{{>statusCodeName}}</td>
A
ascrutae 已提交
22 23 24 25 26 27 28 29 30 31
                        <td><a href="javascript:void(0);" data-toggle="modal" data-target="#modal{{>modalId}}">{{>viewPointIdSub}}</a> </td>
                        <!-- Modal -->
                        <div class="modal fade" id="modal{{>modalId}}" tabindex="-1" role="dialog" aria-labelledby="modal{{>modalId}}Label">
                            <div class="modal-dialog" role="document">
                                <div class="modal-content">
                                    <div class="modal-body">
                                       <ul class="list-group">
                                            <li class="list-group-item" style="word-wrap:break-word"><strong>服务/方法:</strong>{{>viewPointId}}</li>
                                            <li class="list-group-item"><strong>调用类型:</strong>{{>spanTypeName}}</li>
                                            <li class="list-group-item"><strong>花费时间:</strong>{{>cost}}<strong>毫秒</strong></li>
A
ascrutae 已提交
32
                                            <li class="list-group-item" style="word-wrap: break-word;word-break: normal;"><strong>业务字段:</strong>{{>businessKey}}</li>
wu-sheng's avatar
wu-sheng 已提交
33
                                            <li class="list-group-item"><strong>应用Code:</strong>{{>applicationCode}}</li>
A
ascrutae 已提交
34
                                            <li class="list-group-item" style="word-wrap: break-word;word-break: normal;"><strong>主机信息:</strong>{{>address}}}</li>
A
ascrutae 已提交
35
                                            <li class="list-group-item"><strong>调用进程号:</strong>{{>processNo}}</li>
A
ascrutae 已提交
36
                                            <li class="list-group-item" style="word-wrap: break-word;word-break: normal;"><strong>异常堆栈:</strong>
A
ascrutae 已提交
37 38 39 40 41 42 43 44 45 46 47 48
                                                {{if exceptionStack}}
                                                    {{>exceptionStack}}
                                                {{/if}}
                                                {{if serverExceptionStr}}
                                                    <br/>服务端异常堆栈:{{>serverExceptionStr}}
                                                {{/if}}
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
A
ascrutae 已提交
49 50 51 52 53
                        <td>{{>address}}</td>
                        <td>
                         <div class="progress">
                            <div class="progress-bar" style="width: {{>totalLengthPercent}}%"></div>
                        {{if case == 1}}
A
ascrutae 已提交
54
                            <div class="progress-bar progress-bar-b progress-bar-striped" style="color:black;min-width: {{>spiltLengthPercent}}%;">{{>cost}}ms </div>
A
ascrutae 已提交
55 56
                        {{/if}}
                        {{if case == 2}}
A
ascrutae 已提交
57
                            <div class="progress-bar progress-bar-b progress-bar-striped" style="color:black;min-width: {{>spiltLengthPercent}}%;">{{>cost}}ms</div>
A
ascrutae 已提交
58 59 60
                        {{/if}}
                        {{if case == 3}}
                            <div class="progress-bar progress-bar-b progress-bar-striped" style="color:black;min-width: {{>clientCostPercent}}%;"></div>
A
ascrutae 已提交
61
                            <div class="progress-bar progress-bar-a progress-bar-striped" style="color:black;min-width: {{>networkCostPercent}}%;">{{>clientCost}}/{{>networkCost}}/{{>serverCost}}ms</div>
A
ascrutae 已提交
62 63 64
                            <div class="progress-bar progress-bar-b progress-bar-striped" style="color:black;min-width: {{>serverCostPercent}}%;"></div>
                        {{/if}}
                        {{if case == 4}}
A
ascrutae 已提交
65 66
                            <div class="progress-bar progress-bar-b progress-bar-striped" style="color:black;min-width: {{>clientCostPercent}}%;">{{>totalLength}}ms</div>
                            <div class="progress-bar progress-bar-a progress-bar-striped" style="color:black;min-width: {{>serverCostPercent}}%;">->{{>clientCost}}->{{>serverCost}}ms</div>
A
ascrutae 已提交
67 68
                        {{/if}}
                        {{if case == 5}}
A
ascrutae 已提交
69 70
                            <div class="progress-bar progress-bar-b progress-bar-striped" style="color:black;min-width: {{>clientCostPercent}}%;">{{>clientCost}}</div>
                            <div class="progress-bar progress-bar-striped" style="color:black;min-width: {{>networkCostPercent}}%;">/{{>serverCost}}ms</div>
A
ascrutae 已提交
71
                            <div class="progress-bar progress-bar-b progress-bar-striped" style="color:black;min-width: {{>serverCostPercent}}%;"></div>
A
ascrutae 已提交
72
                            <div class="progress-bar progress-split progress-bar-striped" style="color:black;">&nbsp; </div>
A
ascrutae 已提交
73 74 75 76 77
                        {{/if}}
                        </div>
                      </td>
                    </tr>
                {{/for}}
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
                {{if totalSize > maxQueryNodeSize}}
                    <tr data-tt-parent-id='0' data-tt-id="greatThanMaxQueryNodeSize">
                        <td>....</td>
                        <td>....</td>
                        <td>....</td>
                        <td style="text-align:center;color:green;">该调用链超过{{>maxQueryNodeSize}}个节点,仅展现调用入口,具体调用情况可查询HBase</td>
                        <td>....</td>
                        <td>....</td>
                    </tr>
                {{/if}}
                {{if totalSize > maxShowNodeSize && totalSize <= maxQueryNodeSize}}
                    <tr data-tt-parent-id='0' data-tt-id="greatThanMaxShowNodeSize">
                        <td>....</td>
                        <td>....</td>
                        <td>....</td>
                        <td style="text-align:center;color:green;">该调用链共{{>totalSize}}个调用节点,已超过最大展示节点数({{>maxShowNodeSize}}个),仅展现前{{>showSize}}个节点的缩略图</td>
                        <td>....</td>
                        <td>....</td>
                    </tr>
                {{/if}}
A
ascrutae 已提交
98 99 100
            </tbody>
        </table>
</script>
A
ascrutae 已提交
101

A
ascrutae 已提交
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
</#macro>

<#macro traceLogTmpl>
<script type="text/x-jsrender" id="traceLogTmpl">
    <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
        {{for treeNodes}}
        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingOne">
                <h4 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{: #index}}" aria-expanded="true" aria-controls="collapse{{: #index}}">
                            {{if parentLevel }}{{>parentLevel}}.{{/if}}{{>levelId}}---{{>viewPointIdSub}}
                    </a>
                </h4>
            </div>
            <div id="collapse{{: #index}}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
                <div class="panel-body">
                    <ul class="list-group">
                        <li class="list-group-item" style="word-wrap:break-word"><strong>服务/方法:</strong>{{>viewPointId}}</li>
                        <li class="list-group-item"><strong>调用类型:</strong>{{>spanTypeName}}</li>
                        <li class="list-group-item"><strong>调用时间:</strong>{{>startDate}}</li>
                        <li class="list-group-item"><strong>花费时间:</strong>{{>cost}}<strong>毫秒</strong></li>
                        <li class="list-group-item"><strong>业务字段:</strong>{{>businessKey}}</li>
wu-sheng's avatar
wu-sheng 已提交
124
                        <li class="list-group-item"><strong>应用Code:</strong>{{>applicationCode}}</li>
A
ascrutae 已提交
125
                        <li class="list-group-item"><strong>主机信息:</strong>{{>address}}</li>
A
ascrutae 已提交
126 127 128 129
                        <li class="list-group-item"><strong>调用进程号:</strong>{{>processNo}}</li>
                        <li class="list-group-item"><strong>异常堆栈:</strong>
                            {{if exceptionStack}}
                                {{>exceptionStack}}
A
ascrutae 已提交
130 131 132
                            {{/if}}
                            {{if serverExceptionStr}}
                                <br/>服务端异常堆栈:{{>serverExceptionStr}}
A
ascrutae 已提交
133 134 135 136 137 138 139 140 141 142 143 144
                            {{/if}}
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        {{/for}}
    </div>
</script>
</#macro>
<#macro traceTreeAllTmpl>
<script type="text/x-jsrender" id="traceTreeAllTmpl">
A
ascrutae 已提交
145 146 147
        <div class="row">
            <h5>
                {{>traceId}}</br>
148 149 150 151 152 153 154 155
                调度入口IP:{{>callIP}},开始时间:{{>startTimeStr}},
                {{if totalSize > maxQueryNodeSize}}
                    调用超过{{>maxQueryNodeSize}}个节点,仅展示入口调用,
                {{else totalSize > maxShowNodeSize}}
                    共{{>totalSize}}个调用节点,仅展示前{{>showSize}}个调用节点,
                {{else}}
                    {{>totalSize}}个调用节点,
                {{/if}}消耗总时长:{{>totalTime}}ms。
156 157 158
                {{if hasCallChainTree}}
                    <button class="btn btn-primary" onclick="javascript:gotoCallChainTree(this);" value="{{>callChainTreeToken}}">查看调用树</button>
                {{/if}}
A
ascrutae 已提交
159 160
            </h5>
        </div>
A
ascrutae 已提交
161 162 163
        <ul id="myTab" class="nav nav-tabs">
            <li class="active">
                <a href="#traceTree" data-toggle="tab">
A
ascrutae 已提交
164
                   trace tree
A
ascrutae 已提交
165 166
                </a>
            </li>
A
ascrutae 已提交
167
            <li><a href="#traceLog" data-toggle="tab">trace log</a></li>
A
ascrutae 已提交
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
        </ul>

        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade in active" id="traceTree">
                <div class="row" id="traceTreeData">
                    {{include tmpl="#traceTreeTableTmpl"/}}
                </div>
            </div>
            <div class="tab-pane fade" id="traceLog">
                <div class="row" id="traceLogData">
                    {{include tmpl="#traceLogTmpl"/}}
                </div>
            </div>
        </div>
</script>
wu-sheng's avatar
wu-sheng 已提交
183
</#macro>