main.tpl.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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 id="req-container" style="min-width:1100px;height:400px"></div>
  55. <div id="time-container" style="min-width:1100px;height:400px"></div>
  56. <div class="text-center">
  57. <button class="btn btn-primary" type="button">分别统计</button>
  58. <button class="btn btn-primary" type="button">汇总统计</button>
  59. </div>
  60. <table class="table table-hover table-condensed table-bordered">
  61. <thead>
  62. <tr>
  63. <th>时间</th><th>调用总数</th><th>平均耗时</th><th>成功调用总数</th><th>成功平均耗时</th><th>失败调用总数</th><th>失败平均耗时</th><th>成功率</th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. <tr>
  68. <td>
  69. 2014-02-09 00:05:00
  70. </td>
  71. <td>
  72. 13500
  73. </td>
  74. <td>
  75. 0.0268
  76. </td>
  77. <td>
  78. 13500
  79. </td>
  80. <td>
  81. 0.0268
  82. </td>
  83. <td>
  84. 0
  85. </td>
  86. <td>
  87. 0
  88. </td>
  89. <td>
  90. 100%
  91. </td>
  92. </tr>
  93. <tr class="danger">
  94. <td>
  95. 2014-02-09 00:10:00
  96. </td>
  97. <td>
  98. 13500
  99. </td>
  100. <td>
  101. 0.0268
  102. </td>
  103. <td>
  104. 13400
  105. </td>
  106. <td>
  107. 0.0268
  108. </td>
  109. <td>
  110. 100
  111. </td>
  112. <td>
  113. 0.0263
  114. </td>
  115. <td>
  116. 98.1%
  117. </td>
  118. </tr>
  119. <tr>
  120. <td>
  121. 2014-02-09 00:15:00
  122. </td>
  123. <td>
  124. 13500
  125. </td>
  126. <td>
  127. 0.0268
  128. </td>
  129. <td>
  130. 13500
  131. </td>
  132. <td>
  133. 0.0268
  134. </td>
  135. <td>
  136. 0
  137. </td>
  138. <td>
  139. 0
  140. </td>
  141. <td>
  142. 100%
  143. </td>
  144. </tr>
  145. <tr>
  146. <td>
  147. 2014-02-09 00:20:00
  148. </td>
  149. <td>
  150. 13500
  151. </td>
  152. <td>
  153. 0.0268
  154. </td>
  155. <td>
  156. 13500
  157. </td>
  158. <td>
  159. 0.0268
  160. </td>
  161. <td>
  162. 0
  163. </td>
  164. <td>
  165. 0
  166. </td>
  167. <td>
  168. 100%
  169. </td>
  170. </tr>
  171. </tbody>
  172. </table>
  173. </div>
  174. </div>
  175. </div>
  176. <script>
  177. Highcharts.setOptions({
  178. global: {
  179. useUTC: false
  180. }
  181. });
  182. $(function () {
  183. $('#req-container').highcharts({
  184. chart: {
  185. type: 'spline'
  186. },
  187. title: {
  188. text: '<?php echo "$date $interface_name";?> 请求量曲线'
  189. },
  190. subtitle: {
  191. text: ''
  192. },
  193. xAxis: {
  194. type: 'datetime',
  195. dateTimeLabelFormats: {
  196. hour: '%H:%M'
  197. }
  198. },
  199. yAxis: {
  200. title: {
  201. text: '请求量(次/5分钟)'
  202. },
  203. min: 0
  204. },
  205. tooltip: {
  206. formatter: function() {
  207. return '<p style="color:'+this.series.color+';font-weight:bold;">'
  208. + this.series.name +
  209. '</p><br /><p style="color:'+this.series.color+';font-weight:bold;">时间:' + Highcharts.dateFormat('%m月%d日 %H:%M', this.x) +
  210. '</p><br /><p style="color:'+this.series.color+';font-weight:bold;">数量:'+ this.y + '</p>';
  211. }
  212. },
  213. credits: {
  214. enabled: false,
  215. },
  216. series: [ {
  217. name: '成功曲线',
  218. data: [
  219. <?php echo $req_suc_series;?>
  220. ],
  221. lineWidth: 2,
  222. marker:{
  223. radius: 1
  224. },
  225. pointInterval: 300*1000
  226. },
  227. {
  228. name: '失败曲线',
  229. data: [
  230. <?php echo $req_fail_series;?>
  231. ],
  232. lineWidth: 2,
  233. marker:{
  234. radius: 1
  235. },
  236. pointInterval: 300*1000,
  237. color : '#9C0D0D'
  238. }]
  239. });
  240. });
  241. $(function () {
  242. $('#time-container').highcharts({
  243. chart: {
  244. type: 'spline'
  245. },
  246. title: {
  247. text: '<?php echo "$date $interface_name";?> 请求耗时曲线'
  248. },
  249. subtitle: {
  250. text: ''
  251. },
  252. xAxis: {
  253. type: 'datetime',
  254. dateTimeLabelFormats: {
  255. hour: '%H:%M'
  256. }
  257. },
  258. yAxis: {
  259. title: {
  260. text: '平均耗时(单位:秒)'
  261. },
  262. min: 0
  263. },
  264. tooltip: {
  265. formatter: function() {
  266. return '<p style="color:'+this.series.color+';font-weight:bold;">'
  267. + this.series.name +
  268. '</p><br /><p style="color:'+this.series.color+';font-weight:bold;">时间:' + Highcharts.dateFormat('%m月%d日 %H:%M', this.x) +
  269. '</p><br /><p style="color:'+this.series.color+';font-weight:bold;">平均耗时:'+ this.y + '</p>';
  270. }
  271. },
  272. credits: {
  273. enabled: false,
  274. text: "jumei.com",
  275. href: "http://www.jumei.com"
  276. },
  277. series: [ {
  278. name: '成功曲线',
  279. data: [
  280. <?php echo $cost_suc_series;?>
  281. ],
  282. lineWidth: 2,
  283. marker:{
  284. radius: 1
  285. },
  286. pointInterval: 300*1000
  287. },
  288. {
  289. name: '失败曲线',
  290. data: [
  291. <?php echo $cost_fail_series;?>
  292. ],
  293. lineWidth: 2,
  294. marker:{
  295. radius: 1
  296. },
  297. pointInterval: 300*1000,
  298. color : '#9C0D0D'
  299. } ]
  300. });
  301. });
  302. </script>