webroar 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (402) hide show
  1. data/CHANGELOG +7 -0
  2. data/README +1 -1
  3. data/doc/user-guide.html +125 -85
  4. data/doc/user-guide.txt +2 -2
  5. data/lib/constant.rb +23 -16
  6. data/lib/db_connect.rb +2 -3
  7. data/lib/installer.rb +17 -10
  8. data/lib/user_interaction.rb +21 -10
  9. data/lib/webroar_command.rb +21 -23
  10. data/src/admin_panel/Gemfile +8 -0
  11. data/src/admin_panel/Rakefile +2 -5
  12. data/src/admin_panel/app/controllers/application_controller.rb +1 -1
  13. data/src/admin_panel/app/controllers/exceptions_controller.rb +25 -26
  14. data/src/admin_panel/app/controllers/graph_controller.rb +2 -1
  15. data/src/admin_panel/app/helpers/admin_helper.rb +1 -1
  16. data/src/admin_panel/app/{models → mailers}/mailer.rb +5 -8
  17. data/src/admin_panel/app/models/app.rb +1 -1
  18. data/src/admin_panel/app/models/app_exception.rb +15 -11
  19. data/src/admin_panel/app/models/app_time_sample.rb +40 -10
  20. data/src/admin_panel/app/models/application_specification.rb +71 -41
  21. data/src/admin_panel/app/models/resource_usage.rb +76 -55
  22. data/src/admin_panel/app/models/url_breakup_time_sample.rb +6 -11
  23. data/src/admin_panel/app/models/url_time_sample.rb +57 -13
  24. data/src/admin_panel/app/views/admin/_application_table.html.erb +5 -5
  25. data/src/admin_panel/app/views/admin/_feedback_partial.html.erb +4 -4
  26. data/src/admin_panel/app/views/admin/_report_bug_partial.html.erb +5 -5
  27. data/src/admin_panel/app/views/admin/change_password_form.html.erb +3 -3
  28. data/src/admin_panel/app/views/admin/configuration.html.erb +6 -6
  29. data/src/admin_panel/app/views/admin/home.html.erb +4 -4
  30. data/src/admin_panel/app/views/admin/index.html.erb +5 -5
  31. data/src/admin_panel/app/views/application_specification/_application_specification_form.html.erb +15 -6
  32. data/src/admin_panel/app/views/exceptions/_add_and_list_exception_classes.html.erb +7 -6
  33. data/src/admin_panel/app/views/exceptions/_exception_backtrace_partial.html.erb +1 -1
  34. data/src/admin_panel/app/views/exceptions/_exception_environment_partial.html.erb +30 -30
  35. data/src/admin_panel/app/views/exceptions/_exception_list_partial.html.erb +11 -11
  36. data/src/admin_panel/app/views/exceptions/_show.html.erb +8 -8
  37. data/src/admin_panel/app/views/exceptions/index.html.erb +0 -1
  38. data/src/admin_panel/app/views/graph/_get_database_data.html.erb +1 -1
  39. data/src/admin_panel/app/views/graph/_get_resource_usage_data_app.html.erb +2 -2
  40. data/src/admin_panel/app/views/graph/_get_resource_usage_data_server.html.erb +2 -2
  41. data/src/admin_panel/app/views/graph/_get_throughput_data.html.erb +2 -2
  42. data/src/admin_panel/app/views/graph/_get_url_data.html.erb +4 -4
  43. data/src/admin_panel/app/views/graph/_pie.html.erb +2 -2
  44. data/src/admin_panel/app/views/graph/_query_date.html.erb +1 -1
  45. data/src/admin_panel/app/views/graph/_query_period.html.erb +1 -1
  46. data/src/admin_panel/app/views/graph/_slider_partial.html.erb +5 -4
  47. data/src/admin_panel/app/views/graph/index.html.erb +0 -1
  48. data/src/admin_panel/app/views/headers/_add_expires_text_box.html.erb +5 -5
  49. data/src/admin_panel/app/views/headers/_expires_by_type_form.html.erb +1 -1
  50. data/src/admin_panel/app/views/headers/_headers_table.html.erb +12 -12
  51. data/src/admin_panel/app/views/layouts/application.html.erb +71 -51
  52. data/src/admin_panel/app/views/mail_specification/_current_spec.html.erb +4 -4
  53. data/src/admin_panel/app/views/mail_specification/_sendmail_form.html.erb +3 -3
  54. data/src/admin_panel/app/views/mail_specification/_smtp_form.html.erb +3 -3
  55. data/src/admin_panel/app/views/server_specification/_add_div.html.erb +4 -4
  56. data/src/admin_panel/app/views/server_specification/_ssl_support_form.html.erb +3 -2
  57. data/src/admin_panel/config.ru +4 -0
  58. data/src/admin_panel/config/application.rb +46 -0
  59. data/src/admin_panel/config/boot.rb +4 -112
  60. data/src/admin_panel/config/environment.rb +4 -85
  61. data/src/admin_panel/config/environments/development.rb +20 -13
  62. data/src/admin_panel/config/environments/production.rb +44 -17
  63. data/src/admin_panel/config/environments/test.rb +31 -18
  64. data/src/admin_panel/config/initializers/application_constants.rb +13 -11
  65. data/src/admin_panel/config/initializers/secret_token.rb +7 -0
  66. data/src/admin_panel/config/initializers/session_store.rb +8 -0
  67. data/src/admin_panel/config/initializers/ssl.rb +6 -2
  68. data/src/admin_panel/config/routes.rb +15 -57
  69. data/src/admin_panel/doc/README_FOR_APP +1 -1
  70. data/src/admin_panel/doc/app/ActionView.html +229 -0
  71. data/src/admin_panel/doc/app/ActionView/Helpers.html +229 -0
  72. data/src/admin_panel/doc/app/ActionView/Helpers/AssetTagHelper.html +277 -0
  73. data/src/admin_panel/doc/app/AdminController.html +814 -0
  74. data/src/admin_panel/doc/app/AdminHelper.html +495 -0
  75. data/src/admin_panel/doc/app/Analytics.html +272 -0
  76. data/src/admin_panel/doc/app/Analytics/Database.html +401 -0
  77. data/src/admin_panel/doc/app/Analytics/ResourceUsage.html +683 -0
  78. data/src/admin_panel/doc/app/Analytics/Throughput.html +488 -0
  79. data/src/admin_panel/doc/app/Analytics/Url.html +484 -0
  80. data/src/admin_panel/doc/app/Analytics/UrlBreakup.html +537 -0
  81. data/src/admin_panel/doc/app/App.html +489 -0
  82. data/src/admin_panel/doc/app/AppException.html +710 -0
  83. data/src/admin_panel/doc/app/AppTimeSample.html +620 -0
  84. data/src/admin_panel/doc/app/ApplicationController.html +239 -0
  85. data/src/admin_panel/doc/app/ApplicationHelper.html +296 -0
  86. data/src/admin_panel/doc/app/ApplicationSpecification.html +876 -0
  87. data/src/admin_panel/doc/app/ApplicationSpecificationController.html +552 -0
  88. data/src/admin_panel/doc/app/ApplicationSpecificationHelper.html +219 -0
  89. data/src/admin_panel/doc/app/Control.html +431 -0
  90. data/src/admin_panel/doc/app/ExceptionDetail.html +227 -0
  91. data/src/admin_panel/doc/app/ExceptionsController.html +754 -0
  92. data/src/admin_panel/doc/app/ExceptionsHelper.html +219 -0
  93. data/src/admin_panel/doc/app/GraphController.html +1101 -0
  94. data/src/admin_panel/doc/app/GraphHelper.html +285 -0
  95. data/src/admin_panel/doc/app/Headers.html +549 -0
  96. data/src/admin_panel/doc/app/HeadersController.html +507 -0
  97. data/src/admin_panel/doc/app/HeadersHelper.html +219 -0
  98. data/src/admin_panel/doc/app/MailSpecification.html +685 -0
  99. data/src/admin_panel/doc/app/MailSpecificationController.html +541 -0
  100. data/src/admin_panel/doc/app/MailSpecificationHelper.html +219 -0
  101. data/src/admin_panel/doc/app/Mailer.html +589 -0
  102. data/src/admin_panel/doc/app/Object.html +240 -0
  103. data/src/admin_panel/doc/app/PseudoModel.html +354 -0
  104. data/src/admin_panel/doc/app/ResourceUsage.html +656 -0
  105. data/src/admin_panel/doc/app/SCGI.html +674 -0
  106. data/src/admin_panel/doc/app/ServerSpecification.html +479 -0
  107. data/src/admin_panel/doc/app/ServerSpecificationController.html +500 -0
  108. data/src/admin_panel/doc/app/ServerSpecificationHelper.html +219 -0
  109. data/src/admin_panel/doc/app/SignalHelper.html +287 -0
  110. data/src/admin_panel/doc/app/UrlBreakupTimeSample.html +287 -0
  111. data/src/admin_panel/doc/app/UrlTimeSample.html +986 -0
  112. data/src/admin_panel/doc/app/User.html +290 -0
  113. data/src/admin_panel/doc/app/YAMLConfig.html +247 -0
  114. data/src/admin_panel/doc/app/YAMLWriter.html +284 -0
  115. data/src/admin_panel/doc/app/app/controllers/admin_controller_rb.html +52 -0
  116. data/src/admin_panel/doc/app/app/controllers/application_controller_rb.html +54 -0
  117. data/src/admin_panel/doc/app/app/controllers/application_specification_controller_rb.html +52 -0
  118. data/src/admin_panel/doc/app/app/controllers/exceptions_controller_rb.html +52 -0
  119. data/src/admin_panel/doc/app/app/controllers/graph_controller_rb.html +52 -0
  120. data/src/admin_panel/doc/app/app/controllers/headers_controller_rb.html +52 -0
  121. data/src/admin_panel/doc/app/app/controllers/mail_specification_controller_rb.html +52 -0
  122. data/src/admin_panel/doc/app/app/controllers/server_specification_controller_rb.html +52 -0
  123. data/src/admin_panel/doc/app/app/helpers/admin_helper_rb.html +52 -0
  124. data/src/admin_panel/doc/app/app/helpers/application_helper_rb.html +52 -0
  125. data/src/admin_panel/doc/app/app/helpers/application_specification_helper_rb.html +52 -0
  126. data/src/admin_panel/doc/app/app/helpers/exceptions_helper_rb.html +52 -0
  127. data/src/admin_panel/doc/app/app/helpers/graph_helper_rb.html +52 -0
  128. data/src/admin_panel/doc/app/app/helpers/headers_helper_rb.html +52 -0
  129. data/src/admin_panel/doc/app/app/helpers/mail_specification_helper_rb.html +52 -0
  130. data/src/admin_panel/doc/app/app/helpers/server_specification_helper_rb.html +52 -0
  131. data/src/admin_panel/doc/app/app/mailers/mailer_rb.html +56 -0
  132. data/src/admin_panel/doc/app/app/models/app_exception_rb.html +52 -0
  133. data/src/admin_panel/doc/app/app/models/app_rb.html +54 -0
  134. data/src/admin_panel/doc/app/app/models/app_time_sample_rb.html +52 -0
  135. data/src/admin_panel/doc/app/app/models/application_specification_rb.html +52 -0
  136. data/src/admin_panel/doc/app/app/models/exception_detail_rb.html +52 -0
  137. data/src/admin_panel/doc/app/app/models/headers_rb.html +52 -0
  138. data/src/admin_panel/doc/app/app/models/mail_specification_rb.html +52 -0
  139. data/src/admin_panel/doc/app/app/models/pseudo_model_rb.html +52 -0
  140. data/src/admin_panel/doc/app/app/models/resource_usage_rb.html +52 -0
  141. data/src/admin_panel/doc/app/app/models/server_specification_rb.html +52 -0
  142. data/src/admin_panel/doc/app/app/models/url_breakup_time_sample_rb.html +52 -0
  143. data/src/admin_panel/doc/app/app/models/url_time_sample_rb.html +52 -0
  144. data/src/admin_panel/doc/app/app/models/user_rb.html +52 -0
  145. data/src/admin_panel/doc/app/created.rid +42 -1
  146. data/src/admin_panel/doc/app/doc/README_FOR_APP.html +172 -0
  147. data/src/admin_panel/doc/app/images/brick.png +0 -0
  148. data/src/admin_panel/doc/app/images/brick_link.png +0 -0
  149. data/src/admin_panel/doc/app/images/bug.png +0 -0
  150. data/src/admin_panel/doc/app/images/bullet_black.png +0 -0
  151. data/src/admin_panel/doc/app/images/bullet_toggle_minus.png +0 -0
  152. data/src/admin_panel/doc/app/images/bullet_toggle_plus.png +0 -0
  153. data/src/admin_panel/doc/app/images/date.png +0 -0
  154. data/src/admin_panel/doc/app/images/find.png +0 -0
  155. data/src/admin_panel/doc/app/images/loadingAnimation.gif +0 -0
  156. data/src/admin_panel/doc/app/images/macFFBgHack.png +0 -0
  157. data/src/admin_panel/doc/app/images/package.png +0 -0
  158. data/src/admin_panel/doc/app/images/page_green.png +0 -0
  159. data/src/admin_panel/doc/app/images/page_white_text.png +0 -0
  160. data/src/admin_panel/doc/app/images/page_white_width.png +0 -0
  161. data/src/admin_panel/doc/app/images/plugin.png +0 -0
  162. data/src/admin_panel/doc/app/images/ruby.png +0 -0
  163. data/src/admin_panel/doc/app/images/tag_green.png +0 -0
  164. data/src/admin_panel/doc/app/images/wrench.png +0 -0
  165. data/src/admin_panel/doc/app/images/wrench_orange.png +0 -0
  166. data/src/admin_panel/doc/app/images/zoom.png +0 -0
  167. data/src/admin_panel/doc/app/index.html +564 -20
  168. data/src/admin_panel/doc/app/js/darkfish.js +116 -0
  169. data/src/admin_panel/doc/app/js/jquery.js +32 -0
  170. data/src/admin_panel/doc/app/js/quicksearch.js +114 -0
  171. data/src/admin_panel/doc/app/js/thickbox-compressed.js +10 -0
  172. data/src/admin_panel/doc/app/lib/asset_tag_helper_ext_rb.html +52 -0
  173. data/src/admin_panel/doc/app/lib/control_rb.html +58 -0
  174. data/src/admin_panel/doc/app/lib/graph_controller_extensions/database_analytics_rb.html +52 -0
  175. data/src/admin_panel/doc/app/lib/graph_controller_extensions/resource_usage_analytics_rb.html +52 -0
  176. data/src/admin_panel/doc/app/lib/graph_controller_extensions/throughput_analytics_rb.html +52 -0
  177. data/src/admin_panel/doc/app/lib/graph_controller_extensions/url_analytics_rb.html +52 -0
  178. data/src/admin_panel/doc/app/lib/graph_controller_extensions/url_breakup_analytics_rb.html +52 -0
  179. data/src/admin_panel/doc/app/lib/helper_rb.html +52 -0
  180. data/src/admin_panel/doc/app/lib/scgi_rb.html +54 -0
  181. data/src/admin_panel/doc/app/lib/yaml_writer_rb.html +52 -0
  182. data/src/admin_panel/doc/app/rdoc.css +763 -0
  183. data/src/admin_panel/lib/helper.rb +6 -2
  184. data/src/admin_panel/public/stylesheets/other/login.css +8 -4
  185. data/src/admin_panel/public/stylesheets/other/style.css +21 -17
  186. data/src/admin_panel/script/rails +6 -0
  187. data/src/admin_panel/test/test_helper.rb +2 -2
  188. data/src/admin_panel/vendor/plugins/calendar_date_select/History.txt +281 -0
  189. data/src/admin_panel/vendor/plugins/calendar_date_select/MIT-LICENSE +20 -0
  190. data/src/admin_panel/vendor/plugins/calendar_date_select/Manifest.txt +42 -0
  191. data/src/admin_panel/vendor/plugins/calendar_date_select/README.txt +17 -0
  192. data/src/admin_panel/vendor/plugins/calendar_date_select/Rakefile +37 -0
  193. data/src/admin_panel/vendor/plugins/calendar_date_select/VERSION +1 -0
  194. data/src/admin_panel/vendor/plugins/calendar_date_select/calendar_date_select.gemspec +95 -0
  195. data/src/admin_panel/vendor/plugins/calendar_date_select/init.rb +1 -0
  196. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/functional/cds_test.html +376 -0
  197. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/functional/format_iso_date_test.html +52 -0
  198. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/prototype.js +4184 -0
  199. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/test.css +40 -0
  200. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/unit/cds_helper_methods.html +46 -0
  201. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/unittest.js +564 -0
  202. data/src/admin_panel/vendor/plugins/calendar_date_select/lib/calendar_date_select.rb +33 -0
  203. data/src/admin_panel/vendor/plugins/calendar_date_select/lib/calendar_date_select/calendar_date_select.rb +122 -0
  204. data/src/admin_panel/vendor/plugins/calendar_date_select/lib/calendar_date_select/form_helpers.rb +237 -0
  205. data/src/admin_panel/vendor/plugins/calendar_date_select/lib/calendar_date_select/includes_helper.rb +29 -0
  206. data/src/admin_panel/vendor/plugins/calendar_date_select/public/blank_iframe.html +2 -0
  207. data/src/admin_panel/vendor/plugins/calendar_date_select/public/images/calendar_date_select/calendar.gif +0 -0
  208. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/calendar_date_select.js +459 -0
  209. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_american.js +35 -0
  210. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_danish.js +31 -0
  211. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_db.js +27 -0
  212. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_euro_24hr.js +7 -0
  213. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_euro_24hr_ymd.js +7 -0
  214. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_finnish.js +32 -0
  215. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_hyphen_ampm.js +37 -0
  216. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_iso_date.js +29 -0
  217. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_italian.js +24 -0
  218. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/ar.js +10 -0
  219. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/cs.js +11 -0
  220. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/da.js +11 -0
  221. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/de.js +11 -0
  222. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/es.js +11 -0
  223. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/fi.js +10 -0
  224. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/fr.js +11 -0
  225. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/hu.js +11 -0
  226. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/it.js +9 -0
  227. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/ja.js +11 -0
  228. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/nl.js +11 -0
  229. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/pl.js +11 -0
  230. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/pt.js +11 -0
  231. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/ru.js +10 -0
  232. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/sl.js +11 -0
  233. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/sv.js +9 -0
  234. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/blue.css +130 -0
  235. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/default.css +135 -0
  236. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/green.css +142 -0
  237. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/plain.css +128 -0
  238. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/red.css +135 -0
  239. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/silver.css +133 -0
  240. data/src/admin_panel/vendor/plugins/calendar_date_select/spec/calendar_date_select/calendar_date_select_spec.rb +14 -0
  241. data/src/admin_panel/vendor/plugins/calendar_date_select/spec/calendar_date_select/form_helpers_spec.rb +189 -0
  242. data/src/admin_panel/vendor/plugins/calendar_date_select/spec/calendar_date_select/includes_helper_spec.rb +46 -0
  243. data/src/admin_panel/vendor/plugins/calendar_date_select/spec/spec_helper.rb +26 -0
  244. data/src/admin_panel/vendor/plugins/open_flash_chart_2_plugin/install.rb +2 -2
  245. data/src/admin_panel/vendor/plugins/open_flash_chart_2_plugin/uninstall.rb +2 -2
  246. data/src/admin_panel/vendor/plugins/prototype_legacy_helper/README.markdown +13 -0
  247. data/src/admin_panel/vendor/plugins/prototype_legacy_helper/init.rb +1 -0
  248. data/src/admin_panel/vendor/plugins/prototype_legacy_helper/lib/prototype_legacy_helper.rb +432 -0
  249. data/src/admin_panel/vendor/plugins/prototype_legacy_helper/test/test_prototype_helper.rb +297 -0
  250. data/src/helper/wr_config.c +1 -1
  251. data/src/ruby_lib/analyzer/message_analyzer.rb +1 -0
  252. data/src/ruby_lib/analyzer/webroar_analyzer.rb +2 -2
  253. data/src/ruby_lib/profiler/message_dispatcher.rb +1 -1
  254. data/src/ruby_lib/ruby_interface/version.rb +2 -2
  255. data/src/ruby_lib/webroar_app_loader.rb +1 -1
  256. data/tasks/gem.rake +5 -7
  257. data/tasks/test.rake +1 -0
  258. data/test/spec/analytics_spec.rb +25 -24
  259. data/test/spec/test_app/README +142 -129
  260. data/test/spec/test_app/Rakefile +2 -5
  261. data/test/spec/test_app/app/controllers/application_controller.rb +3 -8
  262. data/test/spec/test_app/app/controllers/test_controller.rb +3 -3
  263. data/test/spec/test_app/app/controllers/users_controller.rb +8 -8
  264. data/test/spec/test_app/app/helpers/application_helper.rb +2 -1
  265. data/test/spec/test_app/app/helpers/test_helper.rb +2 -0
  266. data/test/spec/test_app/app/helpers/users_helper.rb +2 -0
  267. data/test/spec/test_app/app/models/user.rb +2 -0
  268. data/test/spec/test_app/app/views/layouts/{users.html.erb → application.html.erb} +6 -9
  269. data/test/spec/test_app/app/views/test/post_data.html.erb +2 -2
  270. data/test/spec/test_app/app/views/test/upload_file.html.erb +1 -1
  271. data/test/spec/test_app/{db/migrate/20090602102438_create_users.rb → app/views/users/_form.html.erb} +22 -11
  272. data/test/spec/test_app/app/views/users/edit.html.erb +19 -28
  273. data/test/spec/test_app/app/views/users/index.html.erb +23 -19
  274. data/test/spec/test_app/app/views/users/new.html.erb +19 -28
  275. data/test/spec/test_app/app/views/users/show.html.erb +21 -18
  276. data/test/spec/test_app/config/application.rb +45 -0
  277. data/test/spec/test_app/config/boot.rb +4 -112
  278. data/test/spec/test_app/config/database.yml +1 -1
  279. data/test/spec/test_app/config/environment.rb +4 -41
  280. data/test/spec/test_app/config/environments/development.rb +22 -13
  281. data/test/spec/test_app/config/environments/production.rb +41 -20
  282. data/test/spec/test_app/config/environments/test.rb +35 -28
  283. data/test/spec/test_app/config/initializers/backtrace_silencers.rb +2 -2
  284. data/test/spec/test_app/config/initializers/inflections.rb +1 -1
  285. data/test/spec/test_app/config/initializers/secret_token.rb +7 -0
  286. data/test/spec/test_app/config/initializers/session_store.rb +3 -10
  287. data/test/spec/test_app/config/locales/en.yml +5 -0
  288. data/test/spec/test_app/config/routes.rb +37 -22
  289. data/test/spec/test_app/db/migrate/20110906113329_create_users.rb +13 -0
  290. data/test/spec/test_app/db/seeds.rb +7 -0
  291. data/test/spec/test_app/public/404.html +15 -19
  292. data/test/spec/test_app/public/422.html +15 -19
  293. data/test/spec/test_app/public/500.html +14 -18
  294. data/test/spec/test_app/public/index.html +41 -77
  295. data/test/spec/test_app/public/javascripts/controls.js +5 -3
  296. data/test/spec/test_app/public/javascripts/dragdrop.js +7 -6
  297. data/test/spec/test_app/public/javascripts/effects.js +8 -13
  298. data/test/spec/test_app/public/javascripts/prototype.js +3381 -1700
  299. data/test/spec/test_app/public/javascripts/rails.js +191 -0
  300. data/test/spec/test_app/public/stylesheets/scaffold.css +15 -13
  301. data/test/spec/test_app/script/rails +6 -0
  302. metadata +340 -163
  303. data/src/admin_panel/Gemfile.lock +0 -79
  304. data/src/admin_panel/doc/app/classes/ActionView.html +0 -111
  305. data/src/admin_panel/doc/app/classes/ActionView/Helpers.html +0 -111
  306. data/src/admin_panel/doc/app/classes/ActionView/Helpers/AssetTagHelper.html +0 -149
  307. data/src/admin_panel/doc/app/classes/AdminController.html +0 -628
  308. data/src/admin_panel/doc/app/classes/AdminHelper.html +0 -482
  309. data/src/admin_panel/doc/app/classes/Analytics.html +0 -138
  310. data/src/admin_panel/doc/app/classes/Analytics/Database.html +0 -245
  311. data/src/admin_panel/doc/app/classes/Analytics/ResourceUsage.html +0 -478
  312. data/src/admin_panel/doc/app/classes/Analytics/Throughput.html +0 -316
  313. data/src/admin_panel/doc/app/classes/Analytics/Url.html +0 -314
  314. data/src/admin_panel/doc/app/classes/Analytics/UrlBreakup.html +0 -372
  315. data/src/admin_panel/doc/app/classes/App.html +0 -298
  316. data/src/admin_panel/doc/app/classes/AppException.html +0 -330
  317. data/src/admin_panel/doc/app/classes/AppTimeSample.html +0 -427
  318. data/src/admin_panel/doc/app/classes/ApplicationController.html +0 -118
  319. data/src/admin_panel/doc/app/classes/ApplicationHelper.html +0 -172
  320. data/src/admin_panel/doc/app/classes/ApplicationSpecification.html +0 -641
  321. data/src/admin_panel/doc/app/classes/ApplicationSpecificationController.html +0 -354
  322. data/src/admin_panel/doc/app/classes/Control.html +0 -273
  323. data/src/admin_panel/doc/app/classes/ExceptionsController.html +0 -612
  324. data/src/admin_panel/doc/app/classes/ExceptionsHelper.html +0 -105
  325. data/src/admin_panel/doc/app/classes/GraphController.html +0 -804
  326. data/src/admin_panel/doc/app/classes/GraphHelper.html +0 -164
  327. data/src/admin_panel/doc/app/classes/MailSpecification.html +0 -357
  328. data/src/admin_panel/doc/app/classes/MailSpecificationController.html +0 -304
  329. data/src/admin_panel/doc/app/classes/PseudoModel.html +0 -206
  330. data/src/admin_panel/doc/app/classes/ResourceUsage.html +0 -425
  331. data/src/admin_panel/doc/app/classes/SCGI.html +0 -406
  332. data/src/admin_panel/doc/app/classes/ServerSpecification.html +0 -325
  333. data/src/admin_panel/doc/app/classes/ServerSpecificationController.html +0 -273
  334. data/src/admin_panel/doc/app/classes/UrlBreakupTimeSample.html +0 -169
  335. data/src/admin_panel/doc/app/classes/UrlTimeSample.html +0 -708
  336. data/src/admin_panel/doc/app/classes/User.html +0 -165
  337. data/src/admin_panel/doc/app/classes/YAMLWriter.html +0 -159
  338. data/src/admin_panel/doc/app/files/app/controllers/admin_controller_rb.html +0 -101
  339. data/src/admin_panel/doc/app/files/app/controllers/application_controller_rb.html +0 -108
  340. data/src/admin_panel/doc/app/files/app/controllers/application_specification_controller_rb.html +0 -101
  341. data/src/admin_panel/doc/app/files/app/controllers/exceptions_controller_rb.html +0 -101
  342. data/src/admin_panel/doc/app/files/app/controllers/graph_controller_rb.html +0 -101
  343. data/src/admin_panel/doc/app/files/app/controllers/mail_specification_controller_rb.html +0 -101
  344. data/src/admin_panel/doc/app/files/app/controllers/server_specification_controller_rb.html +0 -101
  345. data/src/admin_panel/doc/app/files/app/helpers/admin_helper_rb.html +0 -101
  346. data/src/admin_panel/doc/app/files/app/helpers/application_helper_rb.html +0 -101
  347. data/src/admin_panel/doc/app/files/app/helpers/exceptions_helper_rb.html +0 -101
  348. data/src/admin_panel/doc/app/files/app/helpers/graph_helper_rb.html +0 -101
  349. data/src/admin_panel/doc/app/files/app/models/app_exception_rb.html +0 -101
  350. data/src/admin_panel/doc/app/files/app/models/app_rb.html +0 -108
  351. data/src/admin_panel/doc/app/files/app/models/app_time_sample_rb.html +0 -101
  352. data/src/admin_panel/doc/app/files/app/models/application_specification_rb.html +0 -101
  353. data/src/admin_panel/doc/app/files/app/models/mail_specification_rb.html +0 -101
  354. data/src/admin_panel/doc/app/files/app/models/pseudo_model_rb.html +0 -101
  355. data/src/admin_panel/doc/app/files/app/models/resource_usage_rb.html +0 -101
  356. data/src/admin_panel/doc/app/files/app/models/server_specification_rb.html +0 -101
  357. data/src/admin_panel/doc/app/files/app/models/url_breakup_time_sample_rb.html +0 -101
  358. data/src/admin_panel/doc/app/files/app/models/url_time_sample_rb.html +0 -101
  359. data/src/admin_panel/doc/app/files/app/models/user_rb.html +0 -101
  360. data/src/admin_panel/doc/app/files/doc/README_FOR_APP.html +0 -109
  361. data/src/admin_panel/doc/app/files/lib/asset_tag_helper_ext_rb.html +0 -101
  362. data/src/admin_panel/doc/app/files/lib/control_rb.html +0 -110
  363. data/src/admin_panel/doc/app/files/lib/graph_controller_extensions/database_analytics_rb.html +0 -101
  364. data/src/admin_panel/doc/app/files/lib/graph_controller_extensions/resource_usage_analytics_rb.html +0 -101
  365. data/src/admin_panel/doc/app/files/lib/graph_controller_extensions/throughput_analytics_rb.html +0 -101
  366. data/src/admin_panel/doc/app/files/lib/graph_controller_extensions/url_analytics_rb.html +0 -101
  367. data/src/admin_panel/doc/app/files/lib/graph_controller_extensions/url_breakup_analytics_rb.html +0 -101
  368. data/src/admin_panel/doc/app/files/lib/scgi_rb.html +0 -101
  369. data/src/admin_panel/doc/app/files/lib/yaml_writer_rb.html +0 -101
  370. data/src/admin_panel/doc/app/fr_class_index.html +0 -60
  371. data/src/admin_panel/doc/app/fr_file_index.html +0 -58
  372. data/src/admin_panel/doc/app/fr_method_index.html +0 -206
  373. data/src/admin_panel/doc/app/rdoc-style.css +0 -208
  374. data/src/admin_panel/public/dispatch.cgi +0 -10
  375. data/src/admin_panel/public/dispatch.fcgi +0 -24
  376. data/src/admin_panel/public/dispatch.rb +0 -10
  377. data/src/admin_panel/script/about +0 -4
  378. data/src/admin_panel/script/console +0 -3
  379. data/src/admin_panel/script/dbconsole +0 -3
  380. data/src/admin_panel/script/destroy +0 -3
  381. data/src/admin_panel/script/generate +0 -3
  382. data/src/admin_panel/script/performance/benchmarker +0 -3
  383. data/src/admin_panel/script/performance/profiler +0 -3
  384. data/src/admin_panel/script/performance/request +0 -3
  385. data/src/admin_panel/script/plugin +0 -3
  386. data/src/admin_panel/script/process/inspector +0 -3
  387. data/src/admin_panel/script/process/reaper +0 -3
  388. data/src/admin_panel/script/process/spawner +0 -3
  389. data/src/admin_panel/script/runner +0 -3
  390. data/src/admin_panel/script/server +0 -3
  391. data/test/spec/test_app/config/initializers/new_rails_defaults.rb +0 -19
  392. data/test/spec/test_app/script/about +0 -4
  393. data/test/spec/test_app/script/console +0 -3
  394. data/test/spec/test_app/script/dbconsole +0 -3
  395. data/test/spec/test_app/script/destroy +0 -3
  396. data/test/spec/test_app/script/generate +0 -3
  397. data/test/spec/test_app/script/performance/benchmarker +0 -3
  398. data/test/spec/test_app/script/performance/profiler +0 -3
  399. data/test/spec/test_app/script/plugin +0 -3
  400. data/test/spec/test_app/script/runner +0 -3
  401. data/test/spec/test_app/script/server +0 -3
  402. data/test/spec/test_app/vendor/.placeholder +0 -0
@@ -1,330 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: AppException</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">AppException</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../files/app/models/app_exception_rb.html">
59
- app/models/app_exception.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- ActiveRecord::Base
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- Model class for <a href="App.html">App</a> Exceptions. This model helps to
84
- show the details of the exceptions tracked by the server.
85
- </p>
86
-
87
- </div>
88
-
89
-
90
- </div>
91
-
92
- <div id="method-list">
93
- <h3 class="section-bar">Methods</h3>
94
-
95
- <div class="name-list">
96
- <a href="#M000081">count_closed</a>&nbsp;&nbsp;
97
- <a href="#M000082">count_ignored</a>&nbsp;&nbsp;
98
- <a href="#M000080">count_open</a>&nbsp;&nbsp;
99
- <a href="#M000079">get_all</a>&nbsp;&nbsp;
100
- <a href="#M000085">get_exception_details_by_exception_message</a>&nbsp;&nbsp;
101
- <a href="#M000084">get_exception_details_by_id</a>&nbsp;&nbsp;
102
- <a href="#M000083">update_status_to</a>&nbsp;&nbsp;
103
- </div>
104
- </div>
105
-
106
- </div>
107
-
108
-
109
- <!-- if includes -->
110
-
111
- <div id="section">
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
- <!-- if method_list -->
121
- <div id="methods">
122
- <h3 class="section-bar">Public Class methods</h3>
123
-
124
- <div id="method-M000081" class="method-detail">
125
- <a name="M000081"></a>
126
-
127
- <div class="method-heading">
128
- <a href="#M000081" class="method-signature">
129
- <span class="method-name">count_closed</span><span class="method-args">(app_id)</span>
130
- </a>
131
- </div>
132
-
133
- <div class="method-description">
134
- <p>
135
- Take App.id as argument and returns count of distinct closed exceptions for
136
- an Application
137
- </p>
138
- <p><a class="source-toggle" href="#"
139
- onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
140
- <div class="method-source-code" id="M000081-source">
141
- <pre>
142
- <span class="ruby-comment cmt"># File app/models/app_exception.rb, line 35</span>
143
- 35: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count_closed</span>(<span class="ruby-identifier">app_id</span>)
144
- 36: <span class="ruby-identifier">count</span>(<span class="ruby-identifier">:exception_message</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-identifier">:app_id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">:exception_status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">CLOSED_EXCEPTION</span>}, <span class="ruby-identifier">:distinct</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>)
145
- 37: <span class="ruby-keyword kw">end</span>
146
- </pre>
147
- </div>
148
- </div>
149
- </div>
150
-
151
- <div id="method-M000082" class="method-detail">
152
- <a name="M000082"></a>
153
-
154
- <div class="method-heading">
155
- <a href="#M000082" class="method-signature">
156
- <span class="method-name">count_ignored</span><span class="method-args">(app_id)</span>
157
- </a>
158
- </div>
159
-
160
- <div class="method-description">
161
- <p>
162
- Take App.id as argument and returns count of distinct ignored exceptions
163
- for an Application
164
- </p>
165
- <p><a class="source-toggle" href="#"
166
- onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
167
- <div class="method-source-code" id="M000082-source">
168
- <pre>
169
- <span class="ruby-comment cmt"># File app/models/app_exception.rb, line 40</span>
170
- 40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count_ignored</span>(<span class="ruby-identifier">app_id</span>)
171
- 41: <span class="ruby-identifier">count</span>(<span class="ruby-identifier">:exception_message</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-identifier">:app_id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">:exception_status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">IGNORED_EXCEPTION</span>}, <span class="ruby-identifier">:distinct</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>)
172
- 42: <span class="ruby-keyword kw">end</span>
173
- </pre>
174
- </div>
175
- </div>
176
- </div>
177
-
178
- <div id="method-M000080" class="method-detail">
179
- <a name="M000080"></a>
180
-
181
- <div class="method-heading">
182
- <a href="#M000080" class="method-signature">
183
- <span class="method-name">count_open</span><span class="method-args">(app_id)</span>
184
- </a>
185
- </div>
186
-
187
- <div class="method-description">
188
- <p>
189
- Take App.id as argument and returns count of distinct open exceptions for
190
- an Application
191
- </p>
192
- <p><a class="source-toggle" href="#"
193
- onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
194
- <div class="method-source-code" id="M000080-source">
195
- <pre>
196
- <span class="ruby-comment cmt"># File app/models/app_exception.rb, line 30</span>
197
- 30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count_open</span>(<span class="ruby-identifier">app_id</span>)
198
- 31: <span class="ruby-identifier">count</span>(<span class="ruby-identifier">:exception_message</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-identifier">:app_id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">:exception_status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">OPEN_EXCEPTION</span>}, <span class="ruby-identifier">:distinct</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>)
199
- 32: <span class="ruby-keyword kw">end</span>
200
- </pre>
201
- </div>
202
- </div>
203
- </div>
204
-
205
- <div id="method-M000079" class="method-detail">
206
- <a name="M000079"></a>
207
-
208
- <div class="method-heading">
209
- <a href="#M000079" class="method-signature">
210
- <span class="method-name">get_all</span><span class="method-args">(exception_status, app_id, start = 0)</span>
211
- </a>
212
- </div>
213
-
214
- <div class="method-description">
215
- <p>
216
- Gives the array of the five (open|closed|ignored) exceptions starting from
217
- the value of varriable &#8216;start&#8217; for an application.
218
- </p>
219
- <p><a class="source-toggle" href="#"
220
- onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
221
- <div class="method-source-code" id="M000079-source">
222
- <pre>
223
- <span class="ruby-comment cmt"># File app/models/app_exception.rb, line 25</span>
224
- 25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_all</span>(<span class="ruby-identifier">exception_status</span>, <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">start</span> = <span class="ruby-value">0</span>)
225
- 26: <span class="ruby-identifier">all</span>(<span class="ruby-identifier">:select</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'id, exception_message, exception_class, controller, method, wall_time, count(*) as count'</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'app_id = ? and exception_status = ?'</span>, <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">exception_status</span>], <span class="ruby-identifier">:group</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'exception_message'</span>, <span class="ruby-identifier">:limit</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{start}, 5&quot;</span>, <span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'wall_time desc'</span>)
226
- 27: <span class="ruby-keyword kw">end</span>
227
- </pre>
228
- </div>
229
- </div>
230
- </div>
231
-
232
- <div id="method-M000085" class="method-detail">
233
- <a name="M000085"></a>
234
-
235
- <div class="method-heading">
236
- <a href="#M000085" class="method-signature">
237
- <span class="method-name">get_exception_details_by_exception_message</span><span class="method-args">(exception_message, app_id)</span>
238
- </a>
239
- </div>
240
-
241
- <div class="method-description">
242
- <p>
243
- Gives the details af an exception with the help of its exception_message
244
- for a specific application.
245
- </p>
246
- <p><a class="source-toggle" href="#"
247
- onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
248
- <div class="method-source-code" id="M000085-source">
249
- <pre>
250
- <span class="ruby-comment cmt"># File app/models/app_exception.rb, line 60</span>
251
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_exception_details_by_exception_message</span>(<span class="ruby-identifier">exception_message</span>, <span class="ruby-identifier">app_id</span>)
252
- 61: <span class="ruby-identifier">exception</span> = <span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">&quot;exception_message = ? and app_id = ?&quot;</span>, <span class="ruby-identifier">exception_message</span>, <span class="ruby-identifier">app_id</span>], <span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'wall_time desc'</span>)
253
- 62: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">exception</span>
254
- 63: <span class="ruby-keyword kw">end</span>
255
- </pre>
256
- </div>
257
- </div>
258
- </div>
259
-
260
- <div id="method-M000084" class="method-detail">
261
- <a name="M000084"></a>
262
-
263
- <div class="method-heading">
264
- <a href="#M000084" class="method-signature">
265
- <span class="method-name">get_exception_details_by_id</span><span class="method-args">(exception_id)</span>
266
- </a>
267
- </div>
268
-
269
- <div class="method-description">
270
- <p>
271
- Gives the details of the exception with some specific id.
272
- </p>
273
- <p><a class="source-toggle" href="#"
274
- onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
275
- <div class="method-source-code" id="M000084-source">
276
- <pre>
277
- <span class="ruby-comment cmt"># File app/models/app_exception.rb, line 54</span>
278
- 54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_exception_details_by_id</span>(<span class="ruby-identifier">exception_id</span>)
279
- 55: <span class="ruby-identifier">exception</span> = <span class="ruby-identifier">find</span>(<span class="ruby-identifier">:first</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">&quot;id = ?&quot;</span>, <span class="ruby-identifier">exception_id</span>])
280
- 56: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">exception</span>
281
- 57: <span class="ruby-keyword kw">end</span>
282
- </pre>
283
- </div>
284
- </div>
285
- </div>
286
-
287
- <div id="method-M000083" class="method-detail">
288
- <a name="M000083"></a>
289
-
290
- <div class="method-heading">
291
- <a href="#M000083" class="method-signature">
292
- <span class="method-name">update_status_to</span><span class="method-args">(status, app_name, exception_message)</span>
293
- </a>
294
- </div>
295
-
296
- <div class="method-description">
297
- <p>
298
- Update all exceptions status for a matching application and exception
299
- message
300
- </p>
301
- <p><a class="source-toggle" href="#"
302
- onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
303
- <div class="method-source-code" id="M000083-source">
304
- <pre>
305
- <span class="ruby-comment cmt"># File app/models/app_exception.rb, line 45</span>
306
- 45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update_status_to</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">app_name</span>, <span class="ruby-identifier">exception_message</span>)
307
- 46: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">app</span> = <span class="ruby-constant">App</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">:select</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'id'</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">app_name</span>})
308
- 47: <span class="ruby-identifier">app_id</span> = <span class="ruby-identifier">app</span>.<span class="ruby-identifier">id</span>
309
- 48: <span class="ruby-identifier">exceptions_id_array</span> = <span class="ruby-identifier">all</span>(<span class="ruby-identifier">:select</span> =<span class="ruby-operator">&gt;</span><span class="ruby-value str">'id'</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">&quot;exception_message = ? and app_id = ?&quot;</span>, <span class="ruby-identifier">exception_message</span>, <span class="ruby-identifier">app_id</span>]).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">id</span> }
310
- 49: <span class="ruby-identifier">update_all</span>([<span class="ruby-value str">&quot;exception_status = ?&quot;</span>,<span class="ruby-identifier">status</span>], [<span class="ruby-node">&quot;id in (#{exceptions_id_array.join(',')})&quot;</span>])
311
- 50: <span class="ruby-keyword kw">end</span>
312
- 51: <span class="ruby-keyword kw">end</span>
313
- </pre>
314
- </div>
315
- </div>
316
- </div>
317
-
318
-
319
- </div>
320
-
321
-
322
- </div>
323
-
324
-
325
- <div id="validator-badges">
326
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
327
- </div>
328
-
329
- </body>
330
- </html>
@@ -1,427 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: AppTimeSample</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">AppTimeSample</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../files/app/models/app_time_sample_rb.html">
59
- app/models/app_time_sample.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- ActiveRecord::Base
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- This is the model class <a href="AppTimeSample.html">AppTimeSample</a>
84
- related to the application_samples table in the database.
85
- </p>
86
-
87
- </div>
88
-
89
-
90
- </div>
91
-
92
- <div id="method-list">
93
- <h3 class="section-bar">Methods</h3>
94
-
95
- <div class="name-list">
96
- <a href="#M000060">add_to_sample</a>&nbsp;&nbsp;
97
- <a href="#M000059">create_sample</a>&nbsp;&nbsp;
98
- <a href="#M000057">get_application_data</a>&nbsp;&nbsp;
99
- <a href="#M000058">get_max_and_slab</a>&nbsp;&nbsp;
100
- <a href="#M000062">write_all_samples</a>&nbsp;&nbsp;
101
- <a href="#M000061">write_stale_samples</a>&nbsp;&nbsp;
102
- </div>
103
- </div>
104
-
105
- </div>
106
-
107
-
108
- <!-- if includes -->
109
-
110
- <div id="section">
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
- <!-- if method_list -->
120
- <div id="methods">
121
- <h3 class="section-bar">Public Class methods</h3>
122
-
123
- <div id="method-M000060" class="method-detail">
124
- <a name="M000060"></a>
125
-
126
- <div class="method-heading">
127
- <a href="#M000060" class="method-signature">
128
- <span class="method-name">add_to_sample</span><span class="method-args">(message_analyzer, app_id, total_spent_time, db_time, rendering_time, wall_time)</span>
129
- </a>
130
- </div>
131
-
132
- <div class="method-description">
133
- <p>
134
- application_samples contains at the most one sample and that is for current
135
- sampling period. if sample doesn&#8216;t exists ,create it. if sample
136
- exists and wall_time falling in that sampling period, add into sample if
137
- sample exists and wall_time not falling in that sampling period and less
138
- than sampling period, check into database for that sample and update it if
139
- sample exists and wall_time not falling in that sampling period and greater
140
- than sampling period, create new sample and add current into database.
141
- </p>
142
- <p><a class="source-toggle" href="#"
143
- onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
144
- <div class="method-source-code" id="M000060-source">
145
- <pre>
146
- <span class="ruby-comment cmt"># File app/models/app_time_sample.rb, line 106</span>
147
- 106: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_to_sample</span>(<span class="ruby-identifier">message_analyzer</span>, <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">total_spent_time</span>, <span class="ruby-identifier">db_time</span>, <span class="ruby-identifier">rendering_time</span>, <span class="ruby-identifier">wall_time</span>)
148
- 107: <span class="ruby-comment cmt"># create({:app_id =&gt; app_id, :total_time_in_request =&gt; total_spent_time, :db_time =&gt; db_time, :rendering_time =&gt; rendering_time, :number_of_requests =&gt; 1, :wall_time =&gt; wall_time, :sampling_rate =&gt; message_analyzer.sampling_rate }) </span>
149
- 108: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>].<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
150
- 109: <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>] = [<span class="ruby-identifier">wall_time</span>, [<span class="ruby-identifier">total_spent_time</span>, <span class="ruby-identifier">db_time</span>, <span class="ruby-identifier">rendering_time</span>, <span class="ruby-value">1</span>, <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">60</span>,<span class="ruby-value">0</span>)]]
151
- 110: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">wall_time</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>].<span class="ruby-identifier">first</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">wall_time</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>].<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>
152
- 111: <span class="ruby-identifier">sample</span> = <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>][<span class="ruby-value">1</span>]
153
- 112: <span class="ruby-identifier">sample</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">+=</span> <span class="ruby-identifier">total_spent_time</span>
154
- 113: <span class="ruby-identifier">sample</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">+=</span> <span class="ruby-identifier">db_time</span>
155
- 114: <span class="ruby-identifier">sample</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">+=</span> <span class="ruby-identifier">rendering_time</span>
156
- 115: <span class="ruby-identifier">sample</span>[<span class="ruby-value">3</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
157
- 116: <span class="ruby-identifier">sample</span>[<span class="ruby-value">4</span>][<span class="ruby-identifier">wall_time</span>.<span class="ruby-identifier">sec</span>] = (<span class="ruby-identifier">sample</span>[<span class="ruby-value">4</span>][<span class="ruby-identifier">wall_time</span>.<span class="ruby-identifier">sec</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span> ) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
158
- 117: <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>][<span class="ruby-value">1</span>] = <span class="ruby-identifier">sample</span>
159
- 118: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">wall_time</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>].<span class="ruby-identifier">first</span>
160
- 119: <span class="ruby-identifier">db_sample</span> = <span class="ruby-identifier">find</span>(<span class="ruby-identifier">:first</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">&quot;app_id = ? and wall_time &gt;= ? and wall_time &lt;= ?&quot;</span>,<span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">wall_time</span>, <span class="ruby-identifier">wall_time</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>])
161
- 120: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">db_sample</span>
162
- 121: <span class="ruby-identifier">db_sample</span>.<span class="ruby-identifier">total_time_in_request</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">total_spent_time</span>
163
- 122: <span class="ruby-identifier">db_sample</span>.<span class="ruby-identifier">db_time</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">db_time</span>
164
- 123: <span class="ruby-identifier">db_sample</span>.<span class="ruby-identifier">rendering_time</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">rendering_time</span>
165
- 124: <span class="ruby-identifier">db_sample</span>.<span class="ruby-identifier">number_of_requests</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
166
- 125: <span class="ruby-comment cmt">#db_sample.avg_response_time += (total_spent_time / resource_analyzer.worker_count(app_id))</span>
167
- 126: <span class="ruby-identifier">db_sample</span>.<span class="ruby-identifier">save!</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
168
- 127: <span class="ruby-keyword kw">else</span>
169
- 128: <span class="ruby-identifier">wall_time</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>
170
- 129: <span class="ruby-identifier">create_sample</span>(<span class="ruby-identifier">app_id</span>, [<span class="ruby-identifier">total_spent_time</span>, <span class="ruby-identifier">db_time</span>, <span class="ruby-identifier">rendering_time</span>, <span class="ruby-value">1</span>, [<span class="ruby-value">1</span>]], <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>, <span class="ruby-identifier">wall_time</span>)
171
- 130: <span class="ruby-comment cmt">#create({:app_id =&gt; app_id, :total_time_in_request =&gt; total_spent_time, :db_time =&gt; db_time, :rendering_time =&gt; rendering_time, :number_of_requests =&gt; 1, :wall_time =&gt; wall_time, :sampling_rate =&gt; message_analyzer.sampling_rate, :avg_response_time =&gt; 1000, :peak_requests_served =&gt; 1 })</span>
172
- 131: <span class="ruby-keyword kw">end</span>
173
- 132: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">wall_time</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>].<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>
174
- 133: <span class="ruby-identifier">o_wall_time</span> = <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>].<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>
175
- 134: <span class="ruby-identifier">sample</span> = <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>][<span class="ruby-value">1</span>]
176
- 135:
177
- 136: <span class="ruby-identifier">create_sample</span>(<span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">sample</span>, <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>, <span class="ruby-identifier">o_wall_time</span>)
178
- 137:
179
- 138: <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>] = [<span class="ruby-identifier">wall_time</span>, [<span class="ruby-identifier">total_spent_time</span>, <span class="ruby-identifier">db_time</span>, <span class="ruby-identifier">rendering_time</span>, <span class="ruby-value">1</span>, <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">60</span>,<span class="ruby-value">0</span>)]]
180
- 139: <span class="ruby-keyword kw">else</span>
181
- 140: <span class="ruby-identifier">raise</span> <span class="ruby-constant">UndefinedSituation</span>, <span class="ruby-value str">&quot;Think of this possibility!&quot;</span>
182
- 141: <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt"># if</span>
183
- 142: <span class="ruby-keyword kw">end</span>
184
- </pre>
185
- </div>
186
- </div>
187
- </div>
188
-
189
- <div id="method-M000059" class="method-detail">
190
- <a name="M000059"></a>
191
-
192
- <div class="method-heading">
193
- <a href="#M000059" class="method-signature">
194
- <span class="method-name">create_sample</span><span class="method-args">(app_id, sample, sampling_rate, wall_time)</span>
195
- </a>
196
- </div>
197
-
198
- <div class="method-description">
199
- <p>
200
- This section of the model is used by the WebROaR Analyzer.
201
- </p>
202
- <p><a class="source-toggle" href="#"
203
- onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
204
- <div class="method-source-code" id="M000059-source">
205
- <pre>
206
- <span class="ruby-comment cmt"># File app/models/app_time_sample.rb, line 86</span>
207
- 86: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_sample</span>(<span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">sample</span>, <span class="ruby-identifier">sampling_rate</span>, <span class="ruby-identifier">wall_time</span>)
208
- 87: <span class="ruby-comment cmt"># peak requests serverd is maximum of number of requests served in a second </span>
209
- 88: <span class="ruby-identifier">prs</span> = <span class="ruby-identifier">sample</span>[<span class="ruby-value">4</span>].<span class="ruby-identifier">max</span> <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
210
- 89: <span class="ruby-identifier">sample</span>[<span class="ruby-value">4</span>].<span class="ruby-identifier">reject!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>}
211
- 90: <span class="ruby-comment cmt"># time in milisecods / number of requests</span>
212
- 91: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sample</span>[<span class="ruby-value">4</span>].<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
213
- 92: <span class="ruby-identifier">art</span> = (<span class="ruby-identifier">sample</span>[<span class="ruby-value">4</span>].<span class="ruby-identifier">length</span><span class="ruby-operator">*</span><span class="ruby-value">1000</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">sample</span>[<span class="ruby-value">4</span>].<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">sum</span>,<span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">sum</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>}.<span class="ruby-identifier">to_f</span>
214
- 93: <span class="ruby-keyword kw">else</span>
215
- 94: <span class="ruby-identifier">art</span> = <span class="ruby-value">0</span>
216
- 95: <span class="ruby-keyword kw">end</span>
217
- 96: <span class="ruby-comment cmt"># puts 'creating'</span>
218
- 97: <span class="ruby-identifier">with_exception_handling</span>(<span class="ruby-node">&quot;Application sample creation for application #{app_id}, wall_time #{wall_time}&quot;</span>) <span class="ruby-keyword kw">do</span>
219
- 98: <span class="ruby-identifier">create</span>({<span class="ruby-identifier">:app_id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">:total_time_in_request</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">sample</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">:db_time</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">sample</span>[<span class="ruby-value">1</span>], <span class="ruby-identifier">:rendering_time</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">sample</span>[<span class="ruby-value">2</span>], <span class="ruby-identifier">:number_of_requests</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">sample</span>[<span class="ruby-value">3</span>], <span class="ruby-identifier">:wall_time</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">wall_time</span>, <span class="ruby-identifier">:sampling_rate</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">sampling_rate</span>, <span class="ruby-identifier">:avg_response_time</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">art</span>, <span class="ruby-identifier">:peak_requests_served</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">prs</span>})
220
- 99: <span class="ruby-keyword kw">end</span>
221
- 100: <span class="ruby-keyword kw">end</span>
222
- </pre>
223
- </div>
224
- </div>
225
- </div>
226
-
227
- <div id="method-M000057" class="method-detail">
228
- <a name="M000057"></a>
229
-
230
- <div class="method-heading">
231
- <a href="#M000057" class="method-signature">
232
- <span class="method-name">get_application_data</span><span class="method-args">(app_id, start_time, end_time, type)</span>
233
- </a>
234
- </div>
235
-
236
- <div class="method-description">
237
- <p>
238
- This method supplies the url and there statistics to the admin panel
239
- application. This data is used for the graph ploting. This method supplies
240
- the data for database consumption by an application, throughtput and
241
- Average Response Time of an application.
242
- </p>
243
- <p><a class="source-toggle" href="#"
244
- onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
245
- <div class="method-source-code" id="M000057-source">
246
- <pre>
247
- <span class="ruby-comment cmt"># File app/models/app_time_sample.rb, line 29</span>
248
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_application_data</span>(<span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">start_time</span>, <span class="ruby-identifier">end_time</span>, <span class="ruby-identifier">type</span>)
249
- 30: <span class="ruby-identifier">max</span> = <span class="ruby-value">0</span>
250
- 31: <span class="ruby-identifier">interval</span> = <span class="ruby-value">0</span>
251
- 32: <span class="ruby-identifier">interval</span> = ((<span class="ruby-identifier">end_time</span><span class="ruby-operator">-</span><span class="ruby-identifier">start_time</span>) <span class="ruby-operator">/</span> <span class="ruby-value">60</span>).<span class="ruby-identifier">to_i</span>
252
- 33: <span class="ruby-identifier">final_data</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">interval</span>)
253
- 34: <span class="ruby-identifier">wall_time</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">interval</span>)
254
- 35: <span class="ruby-identifier">application_samples</span> = <span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>, <span class="ruby-identifier">:select</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'wall_time, sum(db_time) as db_time,sum(total_time_in_request) as total_time_in_request, sum(number_of_requests) as number_of_requests , avg(avg_response_time) as avg_avg_response_time, avg(peak_requests_served) as avg_peak_requests_served'</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'app_id = ? and wall_time &gt;= ? and wall_time &lt; ?'</span>, <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">start_time</span>, <span class="ruby-identifier">end_time</span>], <span class="ruby-identifier">:group</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'wall_time'</span>)
255
- 36: <span class="ruby-identifier">application_samples</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">application_sample</span><span class="ruby-operator">|</span>
256
- 37: <span class="ruby-identifier">current_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-identifier">application_sample</span>.<span class="ruby-identifier">wall_time</span>.<span class="ruby-identifier">year</span>, <span class="ruby-identifier">application_sample</span>.<span class="ruby-identifier">wall_time</span>.<span class="ruby-identifier">month</span>, <span class="ruby-identifier">application_sample</span>.<span class="ruby-identifier">wall_time</span>.<span class="ruby-identifier">day</span>, <span class="ruby-identifier">application_sample</span>.<span class="ruby-identifier">wall_time</span>.<span class="ruby-identifier">hour</span>, <span class="ruby-identifier">application_sample</span>.<span class="ruby-identifier">wall_time</span>.<span class="ruby-identifier">min</span>, <span class="ruby-value str">'0'</span>)
257
- 38: <span class="ruby-identifier">db_time_data</span> = <span class="ruby-value">0</span>
258
- 39: <span class="ruby-identifier">total_time_in_request</span> = <span class="ruby-value">0</span>
259
- 40: <span class="ruby-identifier">total_requests</span> = <span class="ruby-value">0</span>
260
- 41: <span class="ruby-identifier">total_data</span> = <span class="ruby-value">0</span>
261
- 42: <span class="ruby-identifier">index</span> = (<span class="ruby-identifier">current_time</span><span class="ruby-operator">-</span><span class="ruby-identifier">start_time</span>) <span class="ruby-operator">/</span> <span class="ruby-value">60</span>
262
- 43: <span class="ruby-identifier">total_time_in_request</span> = <span class="ruby-identifier">application_sample</span>.<span class="ruby-identifier">total_time_in_request</span>.<span class="ruby-identifier">to_f</span>
263
- 44: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;db&quot;</span>
264
- 45: <span class="ruby-identifier">db_time_data</span> = <span class="ruby-identifier">application_sample</span>.<span class="ruby-identifier">db_time</span>.<span class="ruby-identifier">to_f</span>
265
- 46: <span class="ruby-identifier">total_data</span> = (<span class="ruby-identifier">db_time_data</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">*</span> <span class="ruby-value">100</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">total_time_in_request</span>.<span class="ruby-identifier">to_f</span>).<span class="ruby-identifier">to_f</span>
266
- 47: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;averageresponsetime&quot;</span>
267
- 48: <span class="ruby-identifier">total_data</span> = <span class="ruby-identifier">application_sample</span>.<span class="ruby-identifier">avg_avg_response_time</span>.<span class="ruby-identifier">to_f</span>
268
- 49: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;throughput&quot;</span>
269
- 50: <span class="ruby-identifier">total_data</span> = <span class="ruby-identifier">application_sample</span>.<span class="ruby-identifier">avg_peak_requests_served</span>.<span class="ruby-identifier">to_f</span>
270
- 51: <span class="ruby-keyword kw">end</span>
271
- 52: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">max</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">total_data</span>
272
- 53: <span class="ruby-identifier">max</span> = <span class="ruby-identifier">total_data</span>.<span class="ruby-identifier">to_i</span>
273
- 54: <span class="ruby-keyword kw">end</span>
274
- 55: <span class="ruby-identifier">final_data</span>[<span class="ruby-identifier">index</span>] = <span class="ruby-identifier">total_data</span>
275
- 56: <span class="ruby-identifier">wall_time</span>[<span class="ruby-identifier">index</span>] = <span class="ruby-identifier">current_time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%H:%M&quot;</span>)
276
- 57: <span class="ruby-keyword kw">end</span>
277
- 58: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">interval</span>
278
- 59: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">final_data</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">nil?</span>
279
- 60: <span class="ruby-identifier">wall_time</span>[<span class="ruby-identifier">i</span>] = (<span class="ruby-identifier">start_time</span><span class="ruby-operator">+</span><span class="ruby-identifier">i</span><span class="ruby-operator">*</span><span class="ruby-value">60</span>).<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%H:%M&quot;</span>)
280
- 61: <span class="ruby-keyword kw">end</span>
281
- 62: <span class="ruby-keyword kw">end</span>
282
- 63: <span class="ruby-identifier">max</span>,<span class="ruby-identifier">slab</span> = <span class="ruby-identifier">get_max_and_slab</span>(<span class="ruby-identifier">max</span>)
283
- 64: <span class="ruby-identifier">step</span> = (<span class="ruby-identifier">interval</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>) <span class="ruby-operator">/</span> <span class="ruby-value">20</span>
284
- 65: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">wall_time</span>, <span class="ruby-identifier">final_data</span>, <span class="ruby-identifier">max</span>, <span class="ruby-identifier">slab</span>, <span class="ruby-identifier">step</span>
285
- 66: <span class="ruby-keyword kw">end</span>
286
- </pre>
287
- </div>
288
- </div>
289
- </div>
290
-
291
- <div id="method-M000058" class="method-detail">
292
- <a name="M000058"></a>
293
-
294
- <div class="method-heading">
295
- <a href="#M000058" class="method-signature">
296
- <span class="method-name">get_max_and_slab</span><span class="method-args">(max)</span>
297
- </a>
298
- </div>
299
-
300
- <div class="method-description">
301
- <p>
302
- This method gives the maximum value for y axis and the value by which the y
303
- axis is to be partitioned.
304
- </p>
305
- <p><a class="source-toggle" href="#"
306
- onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
307
- <div class="method-source-code" id="M000058-source">
308
- <pre>
309
- <span class="ruby-comment cmt"># File app/models/app_time_sample.rb, line 69</span>
310
- 69: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_max_and_slab</span>(<span class="ruby-identifier">max</span>)
311
- 70: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">max</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
312
- 71: <span class="ruby-identifier">max</span> = <span class="ruby-value">1</span>
313
- 72: <span class="ruby-identifier">slab</span> = <span class="ruby-value">1</span>
314
- 73: <span class="ruby-keyword kw">else</span>
315
- 74: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">max</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">8</span>
316
- 75: <span class="ruby-identifier">slab</span> = <span class="ruby-identifier">max</span> <span class="ruby-operator">/</span> <span class="ruby-value">8</span>.<span class="ruby-identifier">to_i</span>
317
- 76: <span class="ruby-keyword kw">else</span>
318
- 77: <span class="ruby-identifier">slab</span> = <span class="ruby-value">1</span>
319
- 78: <span class="ruby-keyword kw">end</span>
320
- 79: <span class="ruby-keyword kw">end</span>
321
- 80: <span class="ruby-identifier">max</span> = <span class="ruby-identifier">max</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">slab</span>
322
- 81: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">max</span>, <span class="ruby-identifier">slab</span>
323
- 82: <span class="ruby-keyword kw">end</span>
324
- </pre>
325
- </div>
326
- </div>
327
- </div>
328
-
329
- <div id="method-M000062" class="method-detail">
330
- <a name="M000062"></a>
331
-
332
- <div class="method-heading">
333
- <a href="#M000062" class="method-signature">
334
- <span class="method-name">write_all_samples</span><span class="method-args">(message_analyzer)</span>
335
- </a>
336
- </div>
337
-
338
- <div class="method-description">
339
- <p>
340
- At time of stopping a script, we would write the samples which are in
341
- memory.
342
- </p>
343
- <p><a class="source-toggle" href="#"
344
- onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
345
- <div class="method-source-code" id="M000062-source">
346
- <pre>
347
- <span class="ruby-comment cmt"># File app/models/app_time_sample.rb, line 166</span>
348
- 166: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_all_samples</span>(<span class="ruby-identifier">message_analyzer</span>)
349
- 167: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
350
- 168: <span class="ruby-keyword kw">return</span>
351
- 169: <span class="ruby-keyword kw">end</span>
352
- 170: <span class="ruby-identifier">samples</span> = <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>
353
- 171: <span class="ruby-identifier">samples</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">sample</span><span class="ruby-operator">|</span>
354
- 172: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sample</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">sample</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
355
- 173: <span class="ruby-identifier">o_wall_time</span> = <span class="ruby-identifier">sample</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>
356
- 174: <span class="ruby-identifier">sample</span> = <span class="ruby-identifier">sample</span>[<span class="ruby-value">1</span>]
357
- 175: <span class="ruby-identifier">create_sample</span>(<span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">sample</span>, <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>, <span class="ruby-identifier">o_wall_time</span>)
358
- 176: <span class="ruby-comment cmt"># peak requests serverd is maximum of number of requests served in a second</span>
359
- 177: <span class="ruby-comment cmt"># prs = sample[4].max</span>
360
- 178: <span class="ruby-comment cmt"># sample[4].reject!{|e| e == 0}</span>
361
- 179: <span class="ruby-comment cmt"># art = sample[4].inject(0){|sum,e| sum + e}.to_f / sample[4].length</span>
362
- 180: <span class="ruby-comment cmt"># create({:app_id =&gt; app_id, :total_time_in_request =&gt; sample[0], :db_time =&gt; sample[1], :rendering_time =&gt; sample[2], :number_of_requests =&gt; sample[3], :wall_time =&gt; o_wall_time, :sampling_rate =&gt; message_analyzer.sampling_rate, :avg_response_time =&gt; ars, :peak_requests_served =&gt; prs})</span>
363
- 181: <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt"># if sample and sample.length &gt; 0</span>
364
- 182: <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt"># do |app_id, sample|</span>
365
- 183: <span class="ruby-keyword kw">end</span>
366
- </pre>
367
- </div>
368
- </div>
369
- </div>
370
-
371
- <div id="method-M000061" class="method-detail">
372
- <a name="M000061"></a>
373
-
374
- <div class="method-heading">
375
- <a href="#M000061" class="method-signature">
376
- <span class="method-name">write_stale_samples</span><span class="method-args">(message_analyzer)</span>
377
- </a>
378
- </div>
379
-
380
- <div class="method-description">
381
- <p>
382
- We have kept sampling period of one minute and would keep any sample in
383
- memory for maximum one minute. By this method we # would write all such
384
- samples which are in memory for more than a minute.
385
- </p>
386
- <p><a class="source-toggle" href="#"
387
- onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
388
- <div class="method-source-code" id="M000061-source">
389
- <pre>
390
- <span class="ruby-comment cmt"># File app/models/app_time_sample.rb, line 145</span>
391
- 145: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_stale_samples</span>(<span class="ruby-identifier">message_analyzer</span>)
392
- 146: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
393
- 147: <span class="ruby-keyword kw">return</span>
394
- 148: <span class="ruby-keyword kw">end</span>
395
- 149: <span class="ruby-identifier">samples</span> = <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>
396
- 150: <span class="ruby-identifier">samples</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">sample</span><span class="ruby-operator">|</span>
397
- 151: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sample</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">sample</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">and</span> (<span class="ruby-identifier">o_wall_time</span> = <span class="ruby-identifier">sample</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>) <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
398
- 152: <span class="ruby-identifier">sample</span> = <span class="ruby-identifier">sample</span>[<span class="ruby-value">1</span>]
399
- 153: <span class="ruby-identifier">create_sample</span>(<span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">sample</span>, <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">sampling_rate</span>, <span class="ruby-identifier">o_wall_time</span>)
400
- 154: <span class="ruby-comment cmt"># peak requests serverd is maximum of number of requests served in a second</span>
401
- 155: <span class="ruby-comment cmt"># prs = sample[4].max</span>
402
- 156: <span class="ruby-comment cmt"># sample[4].reject!{|e| e == 0}</span>
403
- 157: <span class="ruby-comment cmt"># art = sample[4].inject(0){|sum,e| sum + e}.to_f / sample[4].length</span>
404
- 158: <span class="ruby-comment cmt"># create({:app_id =&gt; app_id, :total_time_in_request =&gt; sample[0], :db_time =&gt; sample[1], :rendering_time =&gt; sample[2], :number_of_requests =&gt; sample[3], :wall_time =&gt; o_wall_time, :sampling_rate =&gt; message_analyzer.sampling_rate, :avg_response_time =&gt; ars, :peak_requests_served =&gt; prs})</span>
405
- 159: <span class="ruby-identifier">message_analyzer</span>.<span class="ruby-identifier">application_samples</span>[<span class="ruby-identifier">app_id</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
406
- 160: <span class="ruby-keyword kw">end</span>
407
- 161:
408
- 162: <span class="ruby-keyword kw">end</span>
409
- 163: <span class="ruby-keyword kw">end</span>
410
- </pre>
411
- </div>
412
- </div>
413
- </div>
414
-
415
-
416
- </div>
417
-
418
-
419
- </div>
420
-
421
-
422
- <div id="validator-badges">
423
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
424
- </div>
425
-
426
- </body>
427
- </html>