topic.hbs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. {{> warning}}
  2. {{> error}}
  3. <ol class="breadcrumb">
  4. <li><a class="link" href="{{basePath "/"}}">消息主题</a>
  5. <li class="active">{{name}}</li>
  6. </ol>
  7. <div class="row">
  8. <div class="col-md-6">
  9. <blockquote>
  10. <p>主题: <strong>{{name}}</strong>
  11. </blockquote>
  12. </div>
  13. </div>
  14. {{#unless nodes.length}}
  15. <div class="row">
  16. <div class="col-md-6">
  17. <h4>主题的消息队列</h4>
  18. <div class="alert alert-warning">
  19. <h4>注意</h4> 该主题没有消息生产者.
  20. <p>查看 <a href="{{basePath "/lookup"}}">服务发现</a> 获取更多信息.
  21. </div>
  22. </div>
  23. </div>
  24. {{else}}
  25. {{#if isAdmin}}
  26. <div class="row topic-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">解除暂停主题</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. {{#if e2e_processing_latency.percentiles.length}}
  47. <tr>
  48. <th colspan="{{#if graph_active}}6{{else}}5{{/if}}"></th>
  49. <th colspan="{{e2e_processing_latency.percentiles.length}}">端到端处理延迟</th>
  50. </tr>
  51. {{/if}}
  52. <tr>
  53. <th>消息服务实例</th>
  54. <th>队列</th>
  55. <th>内存 + 磁盘</th>
  56. <th>消息数</th>
  57. {{#if graph_active}}<th>速率</th>{{/if}}
  58. <th>通道</th>
  59. {{#each e2e_processing_latency.percentiles}}
  60. <th>{{floatToPercent quantile}}<sup>{{percSuffix quantile}}</sup></th>
  61. {{/each}}
  62. </tr>
  63. {{#each nodes}}
  64. <tr>
  65. <td>
  66. <button class="btn-link red tombstone-link" data-node="{{node}}" data-topic="{{../name}}" style="padding: 0 6px; border: 0;">✘</button>
  67. {{#if show_broadcast_address}}
  68. {{hostname_port}} (<a class="link" href="{{basePath "/nodes"}}/{{node}}">{{node}}</a>)
  69. {{else}}
  70. <a class="link" href="{{basePath "/nodes"}}/{{node}}">{{hostname_port}}</a>
  71. {{/if}}
  72. {{#if paused}} <span class="label label-primary">paused</span>{{/if}}
  73. </td>
  74. <td>{{commafy depth}}</td>
  75. <td>{{commafy memory_depth}} + {{commafy backend_depth}}</td>
  76. <td>{{commafy message_count}}</td>
  77. {{#if ../graph_active}}
  78. <td class="bold rate" target="{{rate "topic" node topic_name ""}}"></td>
  79. {{/if}}
  80. <td>{{commafy this/channels.length}}</td>
  81. {{#if e2e_processing_latency.percentiles.length}}
  82. {{#each e2e_processing_latency.percentiles}}
  83. <td>
  84. <span title="{{floatToPercent quantile}}: min = {{nanotohuman min}}, max = {{nanotohuman max}}">{{nanotohuman average}}</span>
  85. </td>
  86. {{/each}}
  87. {{/if}}
  88. </tr>
  89. {{#if ../graph_active}}
  90. <tr class="graph-row">
  91. <td></td>
  92. <td><a href="{{large_graph "topic" node topic_name "" "depth"}}"><img width="120" src="{{sparkline "topic" node topic_name "" "depth"}}"></a></td>
  93. <td></td>
  94. <td><a href="{{large_graph "topic" node topic_name "" "message_count"}}"><img width="120" src="{{sparkline "topic" node topic_name "" "message_count"}}"></a></td>
  95. <td></td>
  96. <td></td>
  97. {{#if e2e_processing_latency.percentiles.length}}
  98. <td colspan="{{e2e_processing_latency.percentiles.length}}">
  99. <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>
  100. </td>
  101. {{/if}}
  102. </tr>
  103. {{/if}}
  104. {{/each}}
  105. <tr class="info">
  106. <td>总计:</td>
  107. <td>{{commafy depth}}</td>
  108. <td>{{commafy memory_depth}} + {{commafy backend_depth}}</td>
  109. <td>{{commafy message_count}}</td>
  110. {{#if graph_active}}<td class="bold rate" target="{{rate "topic" "*" topic_name ""}}"></td>{{/if}}
  111. <td>{{commafy channels.length}}</td>
  112. {{#if e2e_processing_latency.percentiles.length}}
  113. {{#each e2e_processing_latency.percentiles}}
  114. <td>
  115. <span title="{{floatToPercent quantile}}: min = {{nanotohuman min}}, max = {{nanotohuman max}}">{{nanotohuman average}}</span>
  116. </td>
  117. {{/each}}
  118. {{/if}}
  119. </tr>
  120. {{#if graph_active}}
  121. <tr class="graph-row">
  122. <td></td>
  123. <td><a href="{{large_graph "topic" "*" topic_name "" "depth"}}"><img width="120" src="{{sparkline "topic" node topic_name "" "depth"}}"></a></td>
  124. <td></td>
  125. <td><a href="{{large_graph "topic" "*" topic_name "" "message_count"}}"><img width="120" src="{{sparkline "topic" node topic_name "" "message_count"}}"></a></td>
  126. <td></td>
  127. <td></td>
  128. {{#if e2e_processing_latency.percentiles.length}}
  129. <td colspan="{{e2e_processing_latency.percentiles.length}}">
  130. <a href="{{large_graph "e2e" "*" e2e_processing_latency "" "e2e_processing_latency"}}"><img width="120" height="20" src="{{sparkline "e2e" node e2e_processing_latency "" "e2e_processing_latency"}}"></a>
  131. </td>
  132. {{/if}}
  133. </tr>
  134. {{/if}}
  135. </table>
  136. </div>
  137. </div>
  138. {{/unless}}
  139. <div class="row">
  140. {{#unless channels.length}}
  141. <div class="col-md-6">
  142. <h4>通道消息队列</h4>
  143. <div class="alert alert-warning">
  144. <h4>注意</h4> 该主题没有通道.
  145. </div>
  146. {{else}}
  147. <div class="col-md-12">
  148. <h4>通道消息队列</h4>
  149. <table class="table table-bordered table-condensed">
  150. {{#if e2e_processing_latency.percentiles.length}}
  151. <tr>
  152. <th colspan="{{#if graph_active}}10{{else}}9{{/if}}"></th>
  153. <th colspan="{{e2e_processing_latency.percentiles.length}}">端到端处理延迟</th>
  154. </tr>
  155. {{/if}}
  156. <tr>
  157. <th>通道</th>
  158. <th>队列</th>
  159. <th>内存 + 硬盘</th>
  160. <th>处理中</th>
  161. <th>推迟</th>
  162. <th>重入队列</th>
  163. <th>超时</th>
  164. <th>消息数</th>
  165. <th>连接数</th>
  166. {{#each e2e_processing_latency.percentiles}}
  167. <th>{{floatToPercent quantile}}<sup>{{percSuffix quantile}}</sup></th>
  168. {{/each}}
  169. </tr>
  170. {{#each channels}}
  171. <tr>
  172. <th>
  173. <a class="link" href="{{basePath "/topics"}}/{{urlencode topic_name}}/{{urlencode channel_name}}">{{channel_name}}</a>
  174. {{#if paused}}<span class="label label-primary">已暂停</span>{{/if}}
  175. </th>
  176. <td>{{commafy depth}}</td>
  177. <td>{{commafy memory_depth}} + {{commafy backend_depth}}</td>
  178. <td>{{commafy in_flight_count}}</td>
  179. <td>{{commafy deferred_count}}</td>
  180. <td>{{commafy requeue_count}}</td>
  181. <td>{{commafy timeout_count}}</td>
  182. <td>{{commafy message_count}}</td>
  183. <td>{{commafy client_count}}</td>
  184. {{#if e2e_processing_latency.percentiles.length}}
  185. {{#each e2e_processing_latency.percentiles}}
  186. <td>
  187. <span title="{{floatToPercent quantile}}: min = {{nanotohuman min}}, max = {{nanotohuman max}}">{{nanotohuman average}}</span>
  188. </td>
  189. {{/each}}
  190. {{/if}}
  191. </tr>
  192. {{#if ../graph_active}}
  193. <tr class="graph-row">
  194. <td></td>
  195. <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>
  196. <td></td>
  197. <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>
  198. <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>
  199. <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>
  200. <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>
  201. <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>
  202. <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>
  203. {{#if e2e_processing_latency.percentiles.length}}
  204. <td colspan="{{e2e_processing_latency.percentiles.length}}">
  205. <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>
  206. </td>
  207. {{/if}}
  208. </tr>
  209. {{/if}}
  210. {{/each}}
  211. </table>
  212. {{/unless}}
  213. </div>
  214. </div>