statistic.tpl.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <div class="container">
  2. <div class="row clearfix">
  3. <div class="col-md-12 column">
  4. <ul class="nav nav-tabs">
  5. <li>
  6. <a href="#">概述</a>
  7. </li>
  8. <li class="active">
  9. <a href="#">监控</a>
  10. </li>
  11. <li class="disabled">
  12. <a href="#">告警</a>
  13. </li>
  14. <li class="dropdown pull-right">
  15. <a href="#" data-toggle="dropdown" class="dropdown-toggle">其它<strong class="caret"></strong></a>
  16. <ul class="dropdown-menu">
  17. <li>
  18. <a href="#">探测节点</a>
  19. </li>
  20. <li>
  21. <a href="#">节点管理</a>
  22. </li>
  23. </ul>
  24. </li>
  25. </ul>
  26. </div>
  27. </div>
  28. <div class="row clearfix">
  29. <div class="col-md-3 column">
  30. <div class="list-group">
  31. <a href="#" class="list-group-item active">HelloWorld</a>
  32. <a href="#" class="list-group-item">sayHello</a>
  33. <a href="#" class="list-group-item">sayHi</a>
  34. <a href="#" class="list-group-item active">User</a>
  35. <a href="#" class="list-group-item active">Blog</a>
  36. </div>
  37. </div>
  38. <div class="col-md-9 column">
  39. <div class="alert alert-dismissable alert-success">
  40. <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
  41. <h4>
  42. Alert!
  43. </h4> <strong>Warning!</strong> Best check yo self, you're not looking too good. <a href="#" class="alert-link">alert link</a>
  44. </div>
  45. <div class="alert alert-dismissable alert-danger">
  46. <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
  47. <h4>
  48. Alert!
  49. </h4> <strong>Warning!</strong> Best check yo self, you're not looking too good. <a href="#" class="alert-link">alert link</a>
  50. </div>
  51. <h3 class="text-primary text-center">
  52. {$module}::{$interface}请求量曲线
  53. </h3>
  54. <div class="row clearfix">
  55. <div class="col-md-12 column" id="req-container" >
  56. </div>
  57. </div>
  58. <div class="row clearfix">
  59. <div class="col-md-12 column" id="time-container" >
  60. </div>
  61. </div>
  62. <div class="text-center">
  63. <button class="btn btn-primary" type="button">分别统计</button>
  64. <button class="btn btn-primary" type="button">汇总统计</button>
  65. </div>
  66. <table class="table table-hover table-condensed table-bordered">
  67. <thead>
  68. <tr>
  69. <th>时间</th><th>调用总数</th><th>平均耗时</th><th>成功调用总数</th><th>成功平均耗时</th><th>失败调用总数</th><th>失败平均耗时</th><th>成功率</th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. <?php echo $table_data;?>
  74. </tbody>
  75. </table>
  76. </div>
  77. </div>
  78. </div>
  79. <script>
  80. Highcharts.setOptions({
  81. global: {
  82. useUTC: false
  83. }
  84. });
  85. $(function () {
  86. $('#req-container').highcharts({
  87. chart: {
  88. type: 'spline'
  89. },
  90. title: {
  91. text: '<?php echo "$date $interface_name";?> 请求量曲线'
  92. },
  93. subtitle: {
  94. text: ''
  95. },
  96. xAxis: {
  97. type: 'datetime',
  98. dateTimeLabelFormats: {
  99. hour: '%H:%M'
  100. }
  101. },
  102. yAxis: {
  103. title: {
  104. text: '请求量(次/5分钟)'
  105. },
  106. min: 0
  107. },
  108. tooltip: {
  109. formatter: function() {
  110. return '<p style="color:'+this.series.color+';font-weight:bold;">'
  111. + this.series.name +
  112. '</p><br /><p style="color:'+this.series.color+';font-weight:bold;">时间:' + Highcharts.dateFormat('%m月%d日 %H:%M', this.x) +
  113. '</p><br /><p style="color:'+this.series.color+';font-weight:bold;">数量:'+ this.y + '</p>';
  114. }
  115. },
  116. credits: {
  117. enabled: false,
  118. },
  119. series: [ {
  120. name: '成功曲线',
  121. data: [
  122. <?php echo $success_series_data;?>
  123. ],
  124. lineWidth: 2,
  125. marker:{
  126. radius: 1
  127. },
  128. pointInterval: 300*1000
  129. },
  130. {
  131. name: '失败曲线',
  132. data: [
  133. <?php echo $fail_series_data;?>
  134. ],
  135. lineWidth: 2,
  136. marker:{
  137. radius: 1
  138. },
  139. pointInterval: 300*1000,
  140. color : '#9C0D0D'
  141. }]
  142. });
  143. });
  144. $(function () {
  145. $('#time-container').highcharts({
  146. chart: {
  147. type: 'spline'
  148. },
  149. title: {
  150. text: '<?php echo "$date $interface_name";?> 请求耗时曲线'
  151. },
  152. subtitle: {
  153. text: ''
  154. },
  155. xAxis: {
  156. type: 'datetime',
  157. dateTimeLabelFormats: {
  158. hour: '%H:%M'
  159. }
  160. },
  161. yAxis: {
  162. title: {
  163. text: '平均耗时(单位:秒)'
  164. },
  165. min: 0
  166. },
  167. tooltip: {
  168. formatter: function() {
  169. return '<p style="color:'+this.series.color+';font-weight:bold;">'
  170. + this.series.name +
  171. '</p><br /><p style="color:'+this.series.color+';font-weight:bold;">时间:' + Highcharts.dateFormat('%m月%d日 %H:%M', this.x) +
  172. '</p><br /><p style="color:'+this.series.color+';font-weight:bold;">平均耗时:'+ this.y + '</p>';
  173. }
  174. },
  175. credits: {
  176. enabled: false,
  177. text: "jumei.com",
  178. href: "http://www.jumei.com"
  179. },
  180. series: [ {
  181. name: '成功曲线',
  182. data: [
  183. <?php echo $success_time_series_data;?>
  184. ],
  185. lineWidth: 2,
  186. marker:{
  187. radius: 1
  188. },
  189. pointInterval: 300*1000
  190. },
  191. {
  192. name: '失败曲线',
  193. data: [
  194. <?php echo $fail_time_series_data;?>
  195. ],
  196. lineWidth: 2,
  197. marker:{
  198. radius: 1
  199. },
  200. pointInterval: 300*1000,
  201. color : '#9C0D0D'
  202. } ]
  203. });
  204. });
  205. </script>