channel.hbs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. {{> warning}}
  2. {{> error}}
  3. <ol class="breadcrumb">
  4. <li><a class="link" href="{{basePath "/"}}">数据流</a>
  5. <li><a class="link" href="{{basePath "/topics"}}/{{urlencode topic}}">{{topic}}</a>
  6. <li class="active">{{name}}</li>
  7. </ol>
  8. <div class="row">
  9. <div class="col-md-6">
  10. <blockquote>
  11. <p>主题:<strong>{{topic}}</strong>
  12. <p>通道: <strong>{{name}}</strong>
  13. </blockquote>
  14. </div>
  15. </div>
  16. {{#unless nodes.length}}
  17. <div class="row">
  18. <div class="col-md-6">
  19. <div class="alert alert-warning">
  20. <h4>注意</h4> 没有消息生产者.
  21. </div>
  22. </div>
  23. </div>
  24. {{else}}
  25. {{#if isAdmin}}
  26. <div class="row channel-actions">
  27. <div class="col-md-2">
  28. <button class="btn btn-medium btn-warning" data-action="empty">清空队列</button>
  29. </div>
  30. <div class="col-md-2">
  31. <button class="btn btn-medium btn-danger" data-action="delete">删除通道</button>
  32. </div>
  33. <div class="col-md-2">
  34. {{#if paused}}
  35. <button class="btn btn-medium btn-success" data-action="unpause">恢复Channel</button>
  36. {{else}}
  37. <button class="btn btn-medium btn-primary" data-action="pause">暂停通道</button>
  38. {{/if}}
  39. </div>
  40. </div>
  41. {{/if}}
  42. <div class="row">
  43. <div class="col-md-12">
  44. <h4>通道</h4>
  45. <table class="table table-bordered table-condensed">
  46. <tr>
  47. <th>&nbsp;</th>
  48. <th colspan="4" class="text-center">消息队列</th>
  49. <th colspan="{{#if graph_active}}5{{else}}4{{/if}}" class="text-center">统计</th>
  50. {{#if e2e_processing_latency.percentiles.length}}
  51. <th colspan="{{e2e_processing_latency.percentiles.length}}">端到端延时</th>
  52. {{/if}}
  53. </tr>
  54. <tr>
  55. <th>主机</th>
  56. <th>队列</th>
  57. <th>内存 + 磁盘</th>
  58. <th>处理中</th>
  59. <th>推迟</th>
  60. <th>重新入队</th>
  61. <th>超时</th>
  62. <th>消息</th>
  63. {{#if graph_active}}<th>速率</th>{{/if}}
  64. <th>已连接</th>
  65. {{#each e2e_processing_latency.percentiles}}
  66. <th>{{floatToPercent quantile}}<sup>{{percSuffix quantile}}</sup></th>
  67. {{/each}}
  68. </tr>
  69. {{#each nodes}}
  70. <tr>
  71. <td>
  72. {{#if show_broadcast_address}}
  73. {{hostname_port}} (<a class="link" href="{{basePath "/nodes"}}/{{node}}">{{node}}</a>)
  74. {{else}}
  75. <a class="link" href="{{basePath "/nodes"}}/{{node}}">{{hostname_port}}</a>
  76. {{/if}}
  77. {{#if paused}} <span class="label label-primary">paused</span>{{/if}}
  78. </td>
  79. <td>{{commafy depth}}</td>
  80. <td>{{commafy memory_depth}} + {{commafy backend_depth}}</td>
  81. <td>{{commafy in_flight_count}}</td>
  82. <td>{{commafy deferred_count}}</td>
  83. <td>{{commafy requeue_count}}</td>
  84. <td>{{commafy timeout_count}}</td>
  85. <td>{{commafy message_count}}</td>
  86. {{#if ../graph_active}}
  87. <td class="bold rate" target="{{rate "topic" node topic_name ""}}"></td>
  88. {{/if}}
  89. <td>{{commafy client_count}}</td>
  90. {{#if e2e_processing_latency.percentiles.length}}
  91. {{#each e2e_processing_latency.percentiles}}
  92. <td>
  93. <span title="{{floatToPercent quantile}}: min = {{nanotohuman min}}, max = {{nanotohuman max}}">{{nanotohuman average}}</span>
  94. </td>
  95. {{/each}}
  96. {{/if}}
  97. </tr>
  98. {{#if ../graph_active}}
  99. <tr class="graph-row">
  100. <td></td>
  101. <td><a href="{{large_graph "channel" node topic_name channel_name "depth"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "depth"}}"></a></td>
  102. <td></td>
  103. <td><a href="{{large_graph "channel" node topic_name channel_name "in_flight_count"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "in_flight_count"}}"></a></td>
  104. <td><a href="{{large_graph "channel" node topic_name channel_name "deferred_count"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "deferred_count"}}"></a></td>
  105. <td><a href="{{large_graph "channel" node topic_name channel_name "requeue_count"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "requeue_count"}}"></a></td>
  106. <td><a href="{{large_graph "channel" node topic_name channel_name "timeout_count"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "timeout_count"}}"></a></td>
  107. <td><a href="{{large_graph "channel" node topic_name channel_name "message_count"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "message_count"}}"></a></td>
  108. <td></td>
  109. <td><a href="{{large_graph "channel" node topic_name channel_name "clients"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "clients"}}"></a></td>
  110. {{#if e2e_processing_latency.percentiles.length}}
  111. <td colspan="{{e2e_processing_latency.percentiles.length}}">
  112. <a href="{{large_graph "e2e" node e2e_processing_latency "" "e2e_processing_latency"}}"><img width="120" height="20" src="{{sparkline "e2e" node e2e_processing_latency "" "e2e_processing_latency"}}"></a>
  113. </td>
  114. {{/if}}
  115. </tr>
  116. {{/if}}
  117. {{/each}}
  118. <tr class="info">
  119. <td>总计:</td>
  120. <td>{{commafy depth}}</td>
  121. <td>{{commafy memory_depth}} + {{commafy backend_depth}}</td>
  122. <td>{{commafy in_flight_count}}</td>
  123. <td>{{commafy deferred_count}}</td>
  124. <td>{{commafy requeue_count}}</td>
  125. <td>{{commafy timeout_count}}</td>
  126. <td>{{commafy message_count}}</td>
  127. {{#if graph_active}}
  128. <td class="bold rate" target="{{rate "topic" node topic_name ""}}"></td>
  129. {{/if}}
  130. <td>{{commafy client_count}}</td>
  131. {{#if e2e_processing_latency.percentiles.length}}
  132. {{#each e2e_processing_latency.percentiles}}
  133. <td>
  134. <span title="{{floatToPercent quantile}}: min = {{nanotohuman min}}, max = {{nanotohuman max}}">{{nanotohuman average}}</span>
  135. </td>
  136. {{/each}}
  137. {{/if}}
  138. </tr>
  139. {{#if graph_active}}
  140. <tr class="graph-row">
  141. <td></td>
  142. <td><a href="{{large_graph "channel" node topic_name channel_name "depth"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "depth"}}"></a></td>
  143. <td></td>
  144. <td><a href="{{large_graph "channel" node topic_name channel_name "in_flight_count"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "in_flight_count"}}"></a></td>
  145. <td><a href="{{large_graph "channel" node topic_name channel_name "deferred_count"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "deferred_count"}}"></a></td>
  146. <td><a href="{{large_graph "channel" node topic_name channel_name "requeue_count"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "requeue_count"}}"></a></td>
  147. <td><a href="{{large_graph "channel" node topic_name channel_name "timeout_count"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "timeout_count"}}"></a></td>
  148. <td><a href="{{large_graph "channel" node topic_name channel_name "message_count"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "message_count"}}"></a></td>
  149. <td></td>
  150. <td><a href="{{large_graph "channel" node topic_name channel_name "clients"}}"><img width="120" height="20" src="{{sparkline "channel" node topic_name channel_name "clients"}}"></a></td>
  151. {{#if e2e_processing_latency.percentiles.length}}
  152. <td colspan="{{e2e_processing_latency.percentiles.length}}">
  153. <a href="{{large_graph "e2e" node e2e_processing_latency "" "e2e_processing_latency"}}"><img width="120" height="20" src="{{sparkline "e2e" node e2e_processing_latency "" "e2e_processing_latency"}}"></a>
  154. </td>
  155. {{/if}}
  156. </tr>
  157. {{/if}}
  158. </table>
  159. </div>
  160. </div>
  161. {{/unless}}
  162. <h4>客户端连接</h4>
  163. <div class="row">
  164. <div class="col-md-12">
  165. {{#unless clients.length}}
  166. <div class="alert alert-warning"><h4>注意</h4>没有客户端连接</div>
  167. {{else}}
  168. <table class="table table-bordered table-condensed">
  169. <tr>
  170. <th>主机</th>
  171. <th>客户端</th>
  172. <th>属性</th>
  173. <th>消息服务主机</th>
  174. <th>处理中</th>
  175. <th>就绪数</th>
  176. <th>完成</th>
  177. <th>重入队列</th>
  178. <th>消息</th>
  179. <th>已连接</th>
  180. </tr>
  181. {{#each clients}}
  182. <tr>
  183. <td title="{{remote_address}}">{{hostname_port}}{{#if show_client_id}} ({{client_id}}){{/if}}</td>
  184. <td>{{#if user_agent.length}}<small>{{user_agent}}</small>{{/if}}</td>
  185. <td>
  186. {{#if sample_rate}}
  187. <span class="label label-info">Sampled {{sample_rate}}%</span>
  188. {{/if}}
  189. {{#if tls}}
  190. <span class="label label-warning" {{#if tls_version}}title="{{tls_version}} {{tls_cipher_suite}} {{tls_negotiated_protocol}} mutual:{{tls_negotiated_protocol_is_mutual}}"{{/if}}>TLS</span>
  191. {{/if}}
  192. {{#if deflate}}
  193. <span class="label label-default">Deflate</span>
  194. {{/if}}
  195. {{#if snappy}}
  196. <span class="label label-primary">Snappy</span>
  197. {{/if}}
  198. {{#if authed}}
  199. <span class="label label-success">
  200. {{#if auth_identity_url}}<a href="{{auth_identity_url}}">{{/if}}
  201. <span class="glyphicon glyphicon-user white" title="Authed{{#if auth_identity}} Identity:{{auth_identity}}{{/if}}"></span>
  202. {{#if auth_identity_url}}</a>{{/if}}
  203. </span>
  204. {{/if}}
  205. </td>
  206. <td><a class="link" href="{{basePath "/nodes"}}/{{node}}">{{node}}</a></td>
  207. <td>{{commafy in_flight_count}}</td>
  208. <td>{{commafy ready_count}}</td>
  209. <td>{{commafy finish_count}}</td>
  210. <td>{{commafy requeue_count}}</td>
  211. <td>{{commafy message_count}}</td>
  212. <td>{{nanotohuman connected}}</td>
  213. </tr>
  214. {{/each}}
  215. </table>
  216. {{/unless}}
  217. </div>
  218. </div>