rails的log分析工具

 wvanbergen-request-log-analyzer (0.1.2)

 

http://github.com/wvanbergen/request-log-analyzer/tree/master#

 

  1. Request log analyzer
  2. --------------------------------
  3. This is a simple command line tool to analyze request log files of both Rails and
  4. Merb. Its purpose is to find what actions are best candidates for optimization.
  5. This tool will parse all requests in the logfile and aggregate the
  6. information. Once it is finished parsing the log file, it will show the
  7. requests that take op most server time. Different metrics are used (cumulative
  8. time, average time, blockers, DB time, etc)
  9. Installation
  10. --------------------------------
  11. gem sources -a http://gems.github.com
  12. sudo gem install wvanbergen-request-log-analyzer
  13. Usage
  14. --------------------------------
  15. Usage: request-log-analyzer [FILE] [OPTION]
  16. Analyze the given log FILE with the given OPTION
  17. Example: request-log-analyzer mongrel.log
  18.   --fast, -t:                 Only use completed requests
  19.   --guess-database-time, -g:  Guesses the database duration of requests if they are not in the log
  20.   --output, -o:               Comma-separated list of reports to show    
  21.   --amount, -c:               Displays the top <amount> elements in the reports
  22.   --colorize, -z:             Fancy bash coloring
  23. Example
  24. --------------------------------
  25. Note that this example was shortened for your viewing pleasure.
  26. $ request-log-analyzer /var/log/my_app.log
  27. Request log analyzer, by Willem van Bergen and  Bart ten Brinke
  28. Processing all log lines...
  29. ========================================================================
  30. Successfully analyzed 58908 requests from log file
  31. Timestamp first request: 2008-07-13T06:25:58+00:00
  32. Timestamp last request:  2008-07-20T06:18:53+00:00
  33. Total time analyzed: 7 days
  34. Methods: DELETE (1%), GET (50%), POST (22%), PUT (25%).
  35. Top 10 most requested actions
  36. ========================================================================
  37. /overview/:date/                                  : 19359 requests
  38. /overview/day/:date/                              : 6365 requests
  39. /overview/:date/set/                              : 5589 requests
  40. /overview/                                        : 3985 requests
  41. /clients/:id/                                     : 1976 requests
  42. ........
  43. Top 10 actions by time - cumulative
  44. ========================================================================
  45. /overview/:date/                                  :   9044.582s [19359 requests]
  46. /overview/                                        :   8478.767s [3985 requests]
  47. /overview/:date/set/                              :   3309.041s [5589 requests]
  48. /clients/:id/products/:id/                        :   1479.911s [924 requests]
  49. /clients/:id/                                     :    750.080s [1976 requests]
  50. ........
  51. Top 10 actions by time - per request mean
  52. ========================================================================
  53. /overview/                                        :      2.128s [3985 requests]
  54. /clients/:id/products/:id/                        :      1.602s [924 requests]
  55. /overview/:date/set/                              :      0.592s [5589 requests]
  56. /overview/:date/                                  :      0.467s [19359 requests]
  57. /clients/:id/                                     :      0.380s [1976 requests]
  58. ........
  59. Top 10 worst DB offenders - cumulative time
  60. ========================================================================
  61. /overview/:date/                                  :   8773.993s [19359 requests]
  62. /overview/                                        :   8394.754s [3985 requests]
  63. /overview/:date/set/                              :   3307.928s [5589 requests]
  64. /clients/:id/products/:id/                        :   1425.220s [924 requests]
  65. /clients/:id/                                     :    535.229s [1976 requests]
  66. ........
  67. Top 10 worst DB offenders - mean time
  68. ========================================================================
  69. /overview/:id/:id/:id/print/                      :      6.994s [448 requests]
  70. /overview/                                        :      2.128s [3985 requests]
  71. /clients/:id/products/:id/                        :      1.602s [924 requests]
  72. /overview/:date/set/                              :      0.592s [5589 requests]
  73. /overview/:date/                                  :      0.467s [19359 requests]
  74. ........
  75. Mongrel process blockers (> 1.0 seconds)
  76. ========================================================================
  77. /overview/:date/                                  :   7494.233s [3144 requests]
  78. /overview/                                        :   8320.293s [1549 requests]
  79. /overview/:date/set/                              :   1149.235s [803 requests]
  80. /overview/:id/:id/:id/print/new/                  :    613.693s [341 requests]
  81. /clients/:id/products/:id/                        :   1370.693s [313 requests]
  82. ........
  83. Requests graph - per hour
  84. ========================================================================
  85.          ........
  86.          7:00 - 2731                 : XXXXXXX
  87.          8:00 - 6139                 : XXXXXXXXXXXXXXXX
  88.          9:00 - 7465                 : XXXXXXXXXXXXXXXXXXXX
  89.         10:00 - 7118                 : XXXXXXXXXXXXXXXXXXX
  90.         11:00 - 7409                 : XXXXXXXXXXXXXXXXXXX
  91.         12:00 - 6450                 : XXXXXXXXXXXXXXXXX
  92.         13:00 - 5377                 : XXXXXXXXXXXXXX
  93.         14:00 - 6058                 : XXXXXXXXXXXXXXXX
  94.         15:00 - 4156                 : XXXXXXXXXXX
  95.         16:00 - 2767                 : XXXXXXX
  96.         17:00 - 1598                 : XXXX
  97.         18:00 - 792                  : XX
  98.         ........
  99. Errors
  100. ========================================================================
  101. ArgumentError: [237 requests]
  102.  -> invalid date
  103. StaleObjectError: [28 requests]
  104.  -> Attempted to update a stale object
  105. RuntimeError: [3 requests]
  106.  -> Cannot destroy rule before it was created
  107. StatementError: [2 requests]
  108.  -> Mysql::Error: Deadlock found when trying to get locktry restarting transaction
  109. NoMethodError: [1 requests]
  110.  -> undefined method `code' for nil:NilClass
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值