maglev-webtools 0.2.1 → 1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. data/README.rdoc +38 -29
  2. data/bin/webtools +22 -1
  3. data/lib/web_tools/code_browser.rb +156 -0
  4. data/lib/web_tools/debugger.rb +96 -199
  5. data/lib/web_tools/info.rb +1 -3
  6. data/lib/web_tools/method_list.rb +67 -0
  7. data/lib/web_tools/middleware/debugger.rb +10 -16
  8. data/lib/web_tools/object_log.rb +24 -0
  9. data/lib/web_tools/session_list.rb +119 -0
  10. data/lib/web_tools/shared_page_cache.rb +30 -0
  11. data/lib/web_tools/stat_process.rb +24 -0
  12. data/lib/web_tools/statistics.rb +14 -0
  13. data/lib/web_tools/support/app_model.rb +66 -101
  14. data/lib/web_tools/support/code_browser.rb +88 -86
  15. data/lib/web_tools/support/debugger.rb +303 -0
  16. data/lib/web_tools/support/error_log.rb +33 -0
  17. data/lib/web_tools/support/ruby.rb +60 -121
  18. data/lib/web_tools/support/service_helper.rb +38 -10
  19. data/lib/web_tools/support/smalltalk_extensions.rb +12 -0
  20. data/lib/web_tools/tool.rb +48 -0
  21. data/lib/web_tools/ui.rb +14 -53
  22. data/lib/web_tools/version_report.rb +29 -0
  23. data/lib/web_tools/workspace.rb +77 -0
  24. data/lib/web_tools.rb +14 -4
  25. data/public/CodeBrowser.html +51 -0
  26. data/public/CodeMirror/LICENSE +19 -0
  27. data/public/CodeMirror/css/codemirror.css +67 -0
  28. data/public/CodeMirror/css/default.css +18 -0
  29. data/public/CodeMirror/js/codemirror.js +2131 -0
  30. data/public/CodeMirror/js/ruby.js +195 -0
  31. data/public/CodeMirror/js/smalltalk.js +139 -0
  32. data/public/Debugger.html +28 -0
  33. data/public/MethodList.html +20 -0
  34. data/public/ObjectLog.html +20 -0
  35. data/public/SessionList.html +31 -0
  36. data/public/SharedPageCache.html +78 -0
  37. data/public/Statistics.html +64 -0
  38. data/public/VersionReport.html +50 -0
  39. data/public/Workspace.html +39 -0
  40. data/public/css/CodeBrowser.css +24 -0
  41. data/public/css/Debugger.css +32 -0
  42. data/public/css/MethodList.css +8 -0
  43. data/public/css/ObjectLog.css +5 -0
  44. data/public/css/SessionList.css +9 -0
  45. data/public/css/Statistics.css +24 -0
  46. data/public/{stylesheets → css}/base/images/ui-anim_basic_16x16.gif +0 -0
  47. data/public/{stylesheets → css}/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  48. data/public/{stylesheets → css}/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  49. data/public/{stylesheets → css}/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  50. data/public/{stylesheets → css}/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  51. data/public/{stylesheets → css}/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  52. data/public/{stylesheets → css}/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  53. data/public/{stylesheets → css}/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  54. data/public/{stylesheets → css}/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  55. data/public/{stylesheets → css}/base/images/ui-icons_222222_256x240.png +0 -0
  56. data/public/{stylesheets → css}/base/images/ui-icons_2e83ff_256x240.png +0 -0
  57. data/public/{stylesheets → css}/base/images/ui-icons_454545_256x240.png +0 -0
  58. data/public/{stylesheets → css}/base/images/ui-icons_888888_256x240.png +0 -0
  59. data/public/{stylesheets → css}/base/images/ui-icons_cd0a0a_256x240.png +0 -0
  60. data/public/{stylesheets → css}/base/jquery.ui.accordion.css +0 -0
  61. data/public/{stylesheets → css}/base/jquery.ui.all.css +0 -0
  62. data/public/{stylesheets → css}/base/jquery.ui.autocomplete.css +0 -0
  63. data/public/{stylesheets → css}/base/jquery.ui.base.css +0 -0
  64. data/public/{stylesheets → css}/base/jquery.ui.button.css +0 -0
  65. data/public/{stylesheets → css}/base/jquery.ui.core.css +0 -0
  66. data/public/{stylesheets → css}/base/jquery.ui.datepicker.css +0 -0
  67. data/public/{stylesheets → css}/base/jquery.ui.dialog.css +0 -0
  68. data/public/{stylesheets → css}/base/jquery.ui.progressbar.css +0 -0
  69. data/public/{stylesheets → css}/base/jquery.ui.resizable.css +0 -0
  70. data/public/{stylesheets → css}/base/jquery.ui.selectable.css +0 -0
  71. data/public/{stylesheets → css}/base/jquery.ui.slider.css +0 -0
  72. data/public/{stylesheets → css}/base/jquery.ui.tabs.css +0 -0
  73. data/public/{stylesheets → css}/base/jquery.ui.theme.css +0 -0
  74. data/public/css/editor.css +25 -0
  75. data/public/css/jjmenu.css +33 -0
  76. data/public/css/menuitem.gif +0 -0
  77. data/public/css/more.gif +0 -0
  78. data/public/{stylesheets → css}/reset.css +1 -1
  79. data/public/css/smoothness/images/ui-anim_basic_16x16.gif +0 -0
  80. data/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  81. data/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  82. data/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  83. data/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  84. data/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  85. data/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  86. data/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  87. data/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  88. data/public/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  89. data/public/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  90. data/public/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  91. data/public/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  92. data/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  93. data/public/css/smoothness/jquery-ui.css +489 -0
  94. data/public/css/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
  95. data/public/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  96. data/public/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  97. data/public/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  98. data/public/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  99. data/public/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  100. data/public/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  101. data/public/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  102. data/public/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  103. data/public/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  104. data/public/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  105. data/public/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  106. data/public/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  107. data/public/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  108. data/public/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  109. data/public/css/ui-lightness/jquery-ui.css +489 -0
  110. data/public/css/webtools.css +65 -0
  111. data/public/favicon.ico +0 -0
  112. data/public/flot/API.txt +1201 -0
  113. data/public/flot/FAQ.txt +76 -0
  114. data/public/flot/LICENSE.txt +22 -0
  115. data/public/flot/Makefile +9 -0
  116. data/public/flot/NEWS.txt +508 -0
  117. data/public/flot/PLUGINS.txt +137 -0
  118. data/public/flot/README.txt +90 -0
  119. data/public/flot/examples/ajax.html +143 -0
  120. data/public/flot/examples/annotating.html +75 -0
  121. data/public/flot/examples/arrow-down.gif +0 -0
  122. data/public/flot/examples/arrow-left.gif +0 -0
  123. data/public/flot/examples/arrow-right.gif +0 -0
  124. data/public/flot/examples/arrow-up.gif +0 -0
  125. data/public/flot/examples/basic.html +38 -0
  126. data/public/flot/examples/data-eu-gdp-growth-1.json +4 -0
  127. data/public/flot/examples/data-eu-gdp-growth-2.json +4 -0
  128. data/public/flot/examples/data-eu-gdp-growth-3.json +4 -0
  129. data/public/flot/examples/data-eu-gdp-growth-4.json +4 -0
  130. data/public/flot/examples/data-eu-gdp-growth-5.json +4 -0
  131. data/public/flot/examples/data-eu-gdp-growth.json +4 -0
  132. data/public/flot/examples/data-japan-gdp-growth.json +4 -0
  133. data/public/flot/examples/data-usa-gdp-growth.json +4 -0
  134. data/public/flot/examples/graph-types.html +75 -0
  135. data/public/flot/examples/hs-2004-27-a-large_web.jpg +0 -0
  136. data/public/flot/examples/image.html +45 -0
  137. data/public/flot/examples/index.html +44 -0
  138. data/public/flot/examples/interacting-axes.html +97 -0
  139. data/public/flot/examples/interacting.html +93 -0
  140. data/public/flot/examples/layout.css +6 -0
  141. data/public/flot/examples/multiple-axes.html +60 -0
  142. data/public/flot/examples/navigate.html +118 -0
  143. data/public/flot/examples/percentiles.html +57 -0
  144. data/public/flot/examples/pie.html +756 -0
  145. data/public/flot/examples/realtime.html +83 -0
  146. data/public/flot/examples/resize.html +61 -0
  147. data/public/flot/examples/selection.html +114 -0
  148. data/public/flot/examples/setting-options.html +61 -0
  149. data/public/flot/examples/stacking.html +77 -0
  150. data/public/flot/examples/symbols.html +49 -0
  151. data/public/flot/examples/thresholding.html +54 -0
  152. data/public/flot/examples/time.html +71 -0
  153. data/public/flot/examples/tracking.html +95 -0
  154. data/public/flot/examples/turning-series.html +98 -0
  155. data/public/flot/examples/visitors.html +90 -0
  156. data/public/flot/examples/zooming.html +98 -0
  157. data/public/flot/excanvas.js +1427 -0
  158. data/public/flot/excanvas.min.js +1 -0
  159. data/public/flot/jquery.colorhelpers.js +179 -0
  160. data/public/flot/jquery.colorhelpers.min.js +1 -0
  161. data/public/flot/jquery.flot.crosshair.js +167 -0
  162. data/public/flot/jquery.flot.crosshair.min.js +1 -0
  163. data/public/flot/jquery.flot.fillbetween.js +183 -0
  164. data/public/flot/jquery.flot.fillbetween.min.js +1 -0
  165. data/public/flot/jquery.flot.image.js +238 -0
  166. data/public/flot/jquery.flot.image.min.js +1 -0
  167. data/public/flot/jquery.flot.js +2599 -0
  168. data/public/flot/jquery.flot.min.js +6 -0
  169. data/public/flot/jquery.flot.navigate.js +336 -0
  170. data/public/flot/jquery.flot.navigate.min.js +1 -0
  171. data/public/flot/jquery.flot.pie.js +750 -0
  172. data/public/flot/jquery.flot.pie.min.js +1 -0
  173. data/public/flot/jquery.flot.resize.js +60 -0
  174. data/public/flot/jquery.flot.resize.min.js +1 -0
  175. data/public/flot/jquery.flot.selection.js +344 -0
  176. data/public/flot/jquery.flot.selection.min.js +1 -0
  177. data/public/flot/jquery.flot.stack.js +184 -0
  178. data/public/flot/jquery.flot.stack.min.js +1 -0
  179. data/public/flot/jquery.flot.symbol.js +70 -0
  180. data/public/flot/jquery.flot.symbol.min.js +1 -0
  181. data/public/flot/jquery.flot.threshold.js +103 -0
  182. data/public/flot/jquery.flot.threshold.min.js +1 -0
  183. data/public/flot/jquery.js +8316 -0
  184. data/public/flot/jquery.min.js +23 -0
  185. data/public/genPacking.pl +30 -0
  186. data/public/index.html +28 -0
  187. data/public/install.tpz +66 -0
  188. data/public/installAndRun.tpz +5 -0
  189. data/public/jsTree/jquery.jstree.js +3510 -0
  190. data/public/jsTree/themes/default/d.gif +0 -0
  191. data/public/jsTree/themes/default/d.png +0 -0
  192. data/public/jsTree/themes/default/style.css +73 -0
  193. data/public/jsTree/themes/default/throbber.gif +0 -0
  194. data/public/readMe.txt +9 -0
  195. data/public/scripts/CodeBrowser.js +645 -0
  196. data/public/scripts/Debugger.js +134 -0
  197. data/public/scripts/MethodList.js +72 -0
  198. data/public/scripts/ObjectLog.js +59 -0
  199. data/public/scripts/SessionList.js +164 -0
  200. data/public/scripts/Statistics.js +266 -0
  201. data/public/scripts/editor.js +430 -0
  202. data/public/scripts/jjmenu.js +375 -0
  203. data/public/scripts/jquery-ui.js +1012 -0
  204. data/public/scripts/jquery.js +154 -0
  205. data/public/scripts/webtools.js +374 -0
  206. data/public/src/CodeBrowser.gs +416 -0
  207. data/public/src/Debugger.gs +132 -0
  208. data/public/src/MethodList.gs +130 -0
  209. data/public/src/ObjectLog.gs +73 -0
  210. data/public/src/Server.gs +544 -0
  211. data/public/src/SessionList.gs +172 -0
  212. data/public/src/SharedPageCache.gs +66 -0
  213. data/public/src/StatProcess.gs +280 -0
  214. data/public/src/StatProcessType.gs +242 -0
  215. data/public/src/StatStatistic.gs +381 -0
  216. data/public/src/Statistics.gs +222 -0
  217. data/public/src/Statmonitor.gs +490 -0
  218. data/public/src/Tool.gs +86 -0
  219. data/public/src/VersionReport.gs +52 -0
  220. data/public/src/Workspace.gs +163 -0
  221. data/views/debugger.rhtml +6 -9
  222. metadata +344 -243
  223. data/lib/web_tools/#debugger.rb# +0 -212
  224. data/lib/web_tools/browser.rb +0 -45
  225. data/public/images/favicon.ico +0 -0
  226. data/public/javascript/CodeMirror/LICENSE +0 -23
  227. data/public/javascript/CodeMirror/css/Smalltalk.css +0 -34
  228. data/public/javascript/CodeMirror/js/codemirror.js +0 -582
  229. data/public/javascript/CodeMirror/js/editor.js +0 -1671
  230. data/public/javascript/CodeMirror/js/highlight.js +0 -68
  231. data/public/javascript/CodeMirror/js/parseSmalltalk.js +0 -126
  232. data/public/javascript/CodeMirror/js/parsedummy.js +0 -32
  233. data/public/javascript/CodeMirror/js/select.js +0 -699
  234. data/public/javascript/CodeMirror/js/stringstream.js +0 -159
  235. data/public/javascript/CodeMirror/js/tokenize.js +0 -57
  236. data/public/javascript/CodeMirror/js/undo.js +0 -413
  237. data/public/javascript/CodeMirror/js/util.js +0 -133
  238. data/public/javascript/CodeMirror/testSmalltalkParser.html +0 -116
  239. data/public/javascript/ace/ace-uncompressed.js +0 -17299
  240. data/public/javascript/ace/ace.js +0 -1
  241. data/public/javascript/ace/keybinding-emacs.js +0 -1
  242. data/public/javascript/ace/keybinding-vim.js +0 -1
  243. data/public/javascript/ace/mode-c_cpp.js +0 -1
  244. data/public/javascript/ace/mode-clojure.js +0 -1
  245. data/public/javascript/ace/mode-coffee.js +0 -1
  246. data/public/javascript/ace/mode-csharp.js +0 -1
  247. data/public/javascript/ace/mode-css.js +0 -1
  248. data/public/javascript/ace/mode-groovy.js +0 -1
  249. data/public/javascript/ace/mode-html.js +0 -1
  250. data/public/javascript/ace/mode-java.js +0 -1
  251. data/public/javascript/ace/mode-javascript.js +0 -1
  252. data/public/javascript/ace/mode-json.js +0 -1
  253. data/public/javascript/ace/mode-lua.js +0 -1
  254. data/public/javascript/ace/mode-markdown.js +0 -1
  255. data/public/javascript/ace/mode-ocaml.js +0 -1
  256. data/public/javascript/ace/mode-perl.js +0 -1
  257. data/public/javascript/ace/mode-php.js +0 -1
  258. data/public/javascript/ace/mode-python.js +0 -1
  259. data/public/javascript/ace/mode-ruby.js +0 -1
  260. data/public/javascript/ace/mode-scad.js +0 -1
  261. data/public/javascript/ace/mode-scala.js +0 -1
  262. data/public/javascript/ace/mode-scss.js +0 -1
  263. data/public/javascript/ace/mode-svg.js +0 -1
  264. data/public/javascript/ace/mode-textile.js +0 -1
  265. data/public/javascript/ace/mode-xml.js +0 -1
  266. data/public/javascript/ace/theme-clouds.js +0 -1
  267. data/public/javascript/ace/theme-clouds_midnight.js +0 -1
  268. data/public/javascript/ace/theme-cobalt.js +0 -1
  269. data/public/javascript/ace/theme-crimson_editor.js +0 -1
  270. data/public/javascript/ace/theme-dawn.js +0 -1
  271. data/public/javascript/ace/theme-eclipse.js +0 -1
  272. data/public/javascript/ace/theme-idle_fingers.js +0 -1
  273. data/public/javascript/ace/theme-kr_theme.js +0 -1
  274. data/public/javascript/ace/theme-merbivore.js +0 -1
  275. data/public/javascript/ace/theme-merbivore_soft.js +0 -1
  276. data/public/javascript/ace/theme-mono_industrial.js +0 -1
  277. data/public/javascript/ace/theme-monokai.js +0 -1
  278. data/public/javascript/ace/theme-pastel_on_dark.js +0 -1
  279. data/public/javascript/ace/theme-solarized_dark.js +0 -1
  280. data/public/javascript/ace/theme-solarized_light.js +0 -1
  281. data/public/javascript/ace/theme-textmate.js +0 -1
  282. data/public/javascript/ace/theme-twilight.js +0 -1
  283. data/public/javascript/ace/theme-vibrant_ink.js +0 -1
  284. data/public/javascript/ace/worker-coffee.js +0 -1
  285. data/public/javascript/ace/worker-css.js +0 -1
  286. data/public/javascript/ace/worker-javascript.js +0 -1
  287. data/public/javascript/webtools/browser.js +0 -260
  288. data/public/javascript/webtools/debugger.coffee +0 -286
  289. data/public/javascript/webtools/debugger.js +0 -366
  290. data/public/javascript/webtools/sessions.coffee +0 -17
  291. data/public/javascript/webtools/sessions.js +0 -27
  292. data/public/javascript/webtools/version.coffee +0 -14
  293. data/public/javascript/webtools/version.js +0 -20
  294. data/public/stylesheets/jquery.contextMenu.css +0 -62
  295. data/public/stylesheets/webtools.css +0 -53
  296. data/public/test.html +0 -47
@@ -0,0 +1,222 @@
1
+ doit
2
+ Tool subclass: 'Statistics'
3
+ instVarNames: #()
4
+ classVars: #()
5
+ classInstVars: #()
6
+ poolDictionaries: #()
7
+ inDictionary: WebTools
8
+ options: #()
9
+
10
+ %
11
+
12
+ ! Remove existing behavior from Statistics
13
+ doit
14
+ Statistics removeAllMethods.
15
+ Statistics class removeAllMethods.
16
+ %
17
+ ! ------------------- Class methods for Statistics
18
+ category: 'other'
19
+ set compile_env: 0
20
+ classmethod: Statistics
21
+ description
22
+
23
+ ^'Load and view statmonitor files'.
24
+ %
25
+ category: 'other'
26
+ set compile_env: 0
27
+ classmethod: Statistics
28
+ displayName
29
+
30
+ ^'Statistics'.
31
+ %
32
+ category: 'other'
33
+ set compile_env: 0
34
+ classmethod: Statistics
35
+ sortOrder
36
+
37
+ ^4.
38
+ %
39
+ ! ------------------- Instance methods for Statistics
40
+ category: 'Public'
41
+ set compile_env: 0
42
+ method: Statistics
43
+ json
44
+
45
+ ^Dictionary new
46
+ at: 'files' put: Statmonitor files;
47
+ yourself.
48
+ %
49
+ category: 'Public'
50
+ set compile_env: 0
51
+ method: Statistics
52
+ process
53
+
54
+ | path oop file process stats nonZero zero |
55
+ path := arguments at: 'path' ifAbsent: [self error: 'Path is missing!'].
56
+ oop := (arguments at: 'processOop' ifAbsent: [self error: 'Process is missing!']) asNumber.
57
+ file := Statmonitor fileAt: path.
58
+ process := file processes
59
+ detect: [:each | each asOop = oop]
60
+ ifNone: [self error: 'Process not found!'].
61
+ stats := process statistics.
62
+ stats := stats asSortedCollection: [:a :b | a name <= b name].
63
+ zero := stats select: [:each | each min = 0 and: [each max = 0]].
64
+ nonZero := stats reject: [:each | each min = 0 and: [each max = 0]].
65
+ stats := nonZero asArray , zero asArray collect: [:each |
66
+ Dictionary new
67
+ at: 'oop' put: each asOop;
68
+ at: 'name' put: each name;
69
+ at: 'type' put: each type;
70
+ at: 'units' put: each units;
71
+ at: 'min' put: each min;
72
+ at: 'max' put: each max;
73
+ at: 'mean' put: each mean;
74
+ at: 'rate' put: each rate;
75
+ at: 'descr' put: each description;
76
+ yourself.
77
+ ].
78
+ ^Dictionary new
79
+ at: 'statistics' put: stats;
80
+ yourself.
81
+ %
82
+ category: 'Public'
83
+ set compile_env: 0
84
+ method: Statistics
85
+ processes
86
+
87
+ | path file processes statNames |
88
+ path := arguments at: 'path' ifAbsent: [self error: 'Path is missing!'].
89
+ file := Statmonitor fileAt: path.
90
+ statNames := Set new.
91
+ file processTypeList do: [:eachType |
92
+ eachType statistics do: [:each | statNames add: each name].
93
+ ].
94
+ processes := file processes collect: [:each |
95
+ Dictionary new
96
+ at: 'oop' put: each asOop;
97
+ at: 'type' put: each type name;
98
+ at: 'pid' put: each processID;
99
+ at: 'session' put: (each sessionID <= 0 ifTrue: [''] ifFalse: [each sessionID]);
100
+ at: 'name' put: each name;
101
+ at: 'count' put: each count;
102
+ at: 'start' put: each beginTime printString;
103
+ at: 'sort' put: each beginTime;
104
+ at: 'prim' put: each primitives;
105
+ at: 'crb' put: each maxCRB;
106
+ yourself.
107
+ ].
108
+ processes := processes asSortedCollection: [:a :b | (a at: 'sort') <= (b at: 'sort')].
109
+ processes do: [:each | each removeKey: 'sort'].
110
+ ^Dictionary new
111
+ at: 'processes' put: processes;
112
+ at: 'statNames' put: statNames asSortedCollection;
113
+ yourself.
114
+ %
115
+ category: 'Public'
116
+ set compile_env: 0
117
+ method: Statistics
118
+ readFile
119
+
120
+ | path |
121
+ path := arguments at: 'path' ifAbsent: [self error: 'Path is missing!'].
122
+ (GsFile existsOnServer: path) ifFalse: [self error: 'File not found!'].
123
+ [Statmonitor path: path] forkAt: Processor userBackgroundPriority.
124
+ (Delay forMilliseconds: 50) wait.
125
+ ^self json.
126
+ %
127
+ category: 'Public'
128
+ set compile_env: 0
129
+ method: Statistics
130
+ removeFile
131
+
132
+ | path |
133
+ path := arguments at: 'path' ifAbsent: [self error: 'Path is missing!'].
134
+ (Statmonitor fileAt: path) remove.
135
+ ^self json.
136
+ %
137
+ category: 'Public'
138
+ set compile_env: 0
139
+ method: Statistics
140
+ spcPageTypes
141
+
142
+ | path file spcMon flotData options |
143
+ path := arguments at: 'path' ifAbsent: [self error: 'Path is missing!'].
144
+ file := Statmonitor fileAt: path.
145
+ spcMon := file sharedPageCacheMonitor.
146
+ flotData := Array new
147
+ add: (Dictionary new
148
+ at: 'data' put: (spcMon statNamed: 'TotalOtherPages') flotData;
149
+ at: 'label' put: 'Other Pages';
150
+ yourself);
151
+ add: (Dictionary new
152
+ at: 'data' put: (spcMon statNamed: 'TotalDataPages') flotData;
153
+ at: 'label' put: 'Data Pages';
154
+ yourself);
155
+ add: (Dictionary new
156
+ at: 'data' put: (spcMon statNamed: 'TotalCrPages') flotData;
157
+ at: 'label' put: 'Commit Record Pages';
158
+ yourself);
159
+ add: (Dictionary new
160
+ at: 'data' put: (spcMon statNamed: 'TotalOtPages') flotData;
161
+ at: 'label' put: 'Object Table Pages';
162
+ yourself);
163
+ add: (Dictionary new
164
+ at: 'data' put: (spcMon statNamed: 'TotalBitmapPages') flotData;
165
+ at: 'label' put: 'Bitmap Pages';
166
+ yourself);
167
+ yourself.
168
+ flotData do: [:each |
169
+ each
170
+ at: 'clickable' put: false;
171
+ at: 'hoverable' put: false;
172
+ yourself.
173
+ ].
174
+ flotData last at: 'hoverable' put: true.
175
+ options := Dictionary new
176
+ at: 'xaxis' put: (Dictionary new at: 'mode' put: 'time'; yourself);
177
+ at: 'grid' put: (Dictionary new at: 'clickable' put: false; at: 'hoverable' put: true; yourself);
178
+ at: 'legend' put: (Dictionary new at: 'position' put: 'se'; yourself);
179
+ at: 'series' put: (Dictionary new at: 'stack' put: true; at: 'lines' put: (Dictionary new at: 'fill' put: true; yourself); yourself);
180
+ yourself.
181
+ ^Dictionary new
182
+ at: 'statName' put: 'spcPageTypes';
183
+ at: 'processOop' put: spcMon asOop;
184
+ at: 'flotData' put: flotData;
185
+ at: 'options' put: options;
186
+ yourself.
187
+ %
188
+ category: 'Public'
189
+ set compile_env: 0
190
+ method: Statistics
191
+ statistic
192
+
193
+ | path oop statName file process statistic flotData options |
194
+ path := arguments at: 'path' ifAbsent: [self error: 'Path is missing!'].
195
+ oop := (arguments at: 'processOop' ifAbsent: [self error: 'Process is missing!']) asNumber.
196
+ statName := arguments at: 'statName' ifAbsent: [self error: 'Statistic name is missing!'].
197
+ file := Statmonitor fileAt: path.
198
+ process := file processes
199
+ detect: [:each | each asOop = oop]
200
+ ifNone: [self error: 'Process not found!'].
201
+ statistic := process statistics
202
+ detect: [:each | each name = statName]
203
+ ifNone: [self error: 'Statistic not found!'].
204
+ flotData := Dictionary new
205
+ at: 'data' put: statistic flotData;
206
+ at: 'label' put: statName;
207
+ yourself.
208
+ options := Dictionary new
209
+ at: 'xaxis' put: (Dictionary new at: 'mode' put: 'time'; yourself);
210
+ at: 'grid' put: (Dictionary new at: 'clickable' put: false; at: 'hoverable' put: true; yourself);
211
+ yourself.
212
+ ^Dictionary new
213
+ at: 'path' put: path;
214
+ at: 'processOop' put: oop;
215
+ at: 'statName' put: statName;
216
+ at: 'flotData' put: (Array with: flotData);
217
+ at: 'options' put: options;
218
+ yourself.
219
+ %
220
+ doit
221
+ Statistics category: 'WebTools'
222
+ %
@@ -0,0 +1,490 @@
1
+ doit
2
+ Object subclass: 'Statmonitor'
3
+ instVarNames: #( path level platform
4
+ gemStoneVersion machine time processTypes)
5
+ classVars: #()
6
+ classInstVars: #()
7
+ poolDictionaries: #()
8
+ inDictionary: WebTools
9
+ options: #()
10
+
11
+ %
12
+
13
+ ! Remove existing behavior from Statmonitor
14
+ doit
15
+ Statmonitor removeAllMethods.
16
+ Statmonitor class removeAllMethods.
17
+ %
18
+ ! ------------------- Class methods for Statmonitor
19
+ category: 'cache'
20
+ set compile_env: 0
21
+ classmethod: Statmonitor
22
+ clearCache
23
+
24
+ WebTools
25
+ removeKey: #'Statmon-Cache' ifAbsent: [];
26
+ yourself.
27
+ %
28
+ category: 'cache'
29
+ set compile_env: 0
30
+ classmethod: Statmonitor
31
+ fileAt: aString
32
+
33
+ ^self files
34
+ detect: [:each | each path = aString]
35
+ ifNone: [self error: 'File not found!'].
36
+ %
37
+ category: 'cache'
38
+ set compile_env: 0
39
+ classmethod: Statmonitor
40
+ files
41
+
42
+ ^WebTools
43
+ at: #'Statmon-Cache'
44
+ ifAbsentPut: [IdentitySet new].
45
+ %
46
+ category: 'Instance Creation'
47
+ set compile_env: 0
48
+ classmethod: Statmonitor
49
+ path: aString
50
+
51
+ (self files anySatisfy: [:each | each path = aString]) ifTrue: [^self].
52
+ (GsFile existsOnServer: aString) ifFalse: [self error: aString printString , ' not found on server'].
53
+ ^self basicNew
54
+ initialize: aString;
55
+ yourself.
56
+ %
57
+ category: 'cache'
58
+ set compile_env: 0
59
+ classmethod: Statmonitor
60
+ remove: aStatmonitor
61
+
62
+ self files remove: aStatmonitor.
63
+
64
+ %
65
+ ! ------------------- Instance methods for Statmonitor
66
+ category: 'initialize'
67
+ set compile_env: 0
68
+ method: Statmonitor
69
+ atEnd
70
+
71
+ ^self streamCache isEmpty and: [self stream atEnd].
72
+ %
73
+ category: 'initialize'
74
+ set compile_env: 0
75
+ method: Statmonitor
76
+ commit
77
+
78
+ System commitTransaction ifFalse: [self error: 'Commit failed!'].
79
+ %
80
+ category: 'initialize'
81
+ set compile_env: 0
82
+ method: Statmonitor
83
+ doAnalysis
84
+
85
+ self
86
+ findCRB;
87
+ yourself.
88
+ %
89
+ category: 'initialize'
90
+ set compile_env: 0
91
+ method: Statmonitor
92
+ findCRB
93
+
94
+ | type stone oldestCrSession timeList dict commitRecordCount |
95
+ type := Statmonitor files asArray first processTypeList detect: [:each | each isStone].
96
+ stone := type processes first.
97
+ oldestCrSession := stone statistics
98
+ detect: [:each | each name = 'OldestCrSession']
99
+ ifNone: [^self].
100
+ timeList := oldestCrSession process timeList.
101
+ commitRecordCount := stone statistics detect: [:each | each name = 'CommitRecordCount'].
102
+ dict := IntegerKeyValueDictionary new.
103
+ 1 to: oldestCrSession data size do: [:i |
104
+ | session time crb |
105
+ session := oldestCrSession data at: i.
106
+ time := timeList at: i.
107
+ crb := commitRecordCount data at: i.
108
+ 0 < session ifTrue: [
109
+ | list |
110
+ list := dict at: session ifAbsentPut: [Array new].
111
+ list add: time -> crb.
112
+ ].
113
+ ].
114
+ type := Statmonitor files asArray first processTypeList detect: [:each | each isGem].
115
+ type processes do: [:eachGem |
116
+ | crbData |
117
+ crbData := dict at: eachGem sessionID ifAbsent: [#()].
118
+ crbData do: [:eachAssoc |
119
+ | index |
120
+ index := eachGem timeList indexOf: eachAssoc key.
121
+ 0 < index ifTrue: [
122
+ eachGem crb add: eachAssoc.
123
+ ].
124
+ ].
125
+ ].
126
+ %
127
+ category: 'accessors'
128
+ set compile_env: 0
129
+ method: Statmonitor
130
+ gemStoneVersion
131
+
132
+ ^gemStoneVersion.
133
+ %
134
+ category: 'initialize'
135
+ set compile_env: 0
136
+ method: Statmonitor
137
+ headerAt: aString
138
+
139
+ | line |
140
+ (line := self headerLine) key = aString ifFalse: [self error: aString , ' not found in header'].
141
+ ^line value.
142
+ %
143
+ category: 'initialize'
144
+ set compile_env: 0
145
+ method: Statmonitor
146
+ headerLine
147
+
148
+ | line key value |
149
+ line := self nextLine subStrings: $".
150
+ key := ((line at: 1) subStrings: $=) first trimBlanks.
151
+ value := line at: 2.
152
+ ^key -> value.
153
+
154
+ %
155
+ category: 'initialize'
156
+ set compile_env: 0
157
+ method: Statmonitor
158
+ initialize: aString
159
+
160
+ | myStream |
161
+ path := aString.
162
+ self class files add: self.
163
+ self commit.
164
+ myStream := (aString copyFrom: aString size - 2 to: aString size) = '.gz'
165
+ ifTrue: [GsFile openReadOnServerCompressed: aString]
166
+ ifFalse: [GsFile openReadOnServer: aString].
167
+ self stream: myStream.
168
+ self streamCache size: 0.
169
+ [
170
+ self
171
+ readHeader;
172
+ readData;
173
+ doAnalysis;
174
+ yourself.
175
+ ] ensure: [
176
+ myStream close.
177
+ self stream: nil.
178
+ ].
179
+ self commit.
180
+ %
181
+ category: 'public'
182
+ set compile_env: 0
183
+ method: Statmonitor
184
+ jsonKeys
185
+
186
+ ^#(path level platform gemStoneVersion machine time).
187
+ %
188
+ category: 'accessors'
189
+ set compile_env: 0
190
+ method: Statmonitor
191
+ level
192
+
193
+ ^level.
194
+
195
+ %
196
+ category: 'accessors'
197
+ set compile_env: 0
198
+ method: Statmonitor
199
+ machine
200
+
201
+ ^machine.
202
+
203
+ %
204
+ category: 'initialize'
205
+ set compile_env: 0
206
+ method: Statmonitor
207
+ nextLine
208
+
209
+ ^self upTo: Character lf.
210
+ %
211
+ category: 'initialize'
212
+ set compile_env: 0
213
+ method: Statmonitor
214
+ nextRow
215
+
216
+ | line list listIndex value i j string |
217
+ (line := self nextLine) isEmpty ifTrue: [^#()].
218
+ i := line indexOf: $ startingAt: 1.
219
+ i := line indexOf: $ startingAt: i + 1.
220
+ j := line indexOf: $ startingAt: i + 1.
221
+ string := line copyFrom: i + 1 to: j - 1.
222
+ list := Array new.
223
+ listIndex := 1.
224
+ value := 0.
225
+ 1 to: line size do: [:i |
226
+ | char |
227
+ (char := line at: i) == $ ifTrue: [
228
+ list at: listIndex put: value.
229
+ listIndex := listIndex + 1.
230
+ value := 0.
231
+ ] ifFalse: [
232
+ value := value * 10 + char codePoint - 48 "codePoint for zero"
233
+ ].
234
+ ].
235
+ list add: value.
236
+ list at: 3 put: string.
237
+ ^list.
238
+ %
239
+ category: 'initialize'
240
+ set compile_env: 0
241
+ method: Statmonitor
242
+ nextRowA
243
+
244
+ | line list listIndex value |
245
+ (line := self nextLine) isEmpty ifTrue: [^#()].
246
+ list := Array new.
247
+ listIndex := 1.
248
+ value := 0.
249
+ 1 to: line size do: [:i |
250
+ | char |
251
+ (char := line at: i) == $ ifTrue: [
252
+ list at: listIndex put: value.
253
+ listIndex := listIndex + 1.
254
+ value := listIndex == 3 ifTrue: [String new] ifFalse: [0].
255
+ ] ifFalse: [
256
+ listIndex == 3
257
+ ifTrue: [value add: char]
258
+ ifFalse: [value := value * 10 + char codePoint - 48 "codePoint for zero"]
259
+ ].
260
+ ].
261
+ list add: value.
262
+ ^list.
263
+ %
264
+ category: 'accessors'
265
+ set compile_env: 0
266
+ method: Statmonitor
267
+ path
268
+
269
+ ^path.
270
+
271
+ %
272
+ category: 'accessors'
273
+ set compile_env: 0
274
+ method: Statmonitor
275
+ platform
276
+
277
+ ^platform.
278
+
279
+ %
280
+ category: 'public'
281
+ set compile_env: 0
282
+ method: Statmonitor
283
+ printOn: aStream
284
+
285
+ aStream nextPutAll: path.
286
+
287
+ %
288
+ category: 'accessors'
289
+ set compile_env: 0
290
+ method: Statmonitor
291
+ processes
292
+
293
+ | list |
294
+ list := OrderedCollection new.
295
+ self processTypeList do: [:eachType |
296
+ eachType processes do: [:each |
297
+ list add: each.
298
+ ].
299
+ ].
300
+ ^list.
301
+ %
302
+ category: 'accessors'
303
+ set compile_env: 0
304
+ method: Statmonitor
305
+ processesWithNonZero: aString
306
+
307
+ ^self processes select: [:each |
308
+ | stat |
309
+ stat := each statNamed: aString.
310
+ stat notNil and: [0 < stat max].
311
+ ].
312
+ %
313
+ category: 'accessors'
314
+ set compile_env: 0
315
+ method: Statmonitor
316
+ processTypeList
317
+
318
+ ^processTypes asSortedCollection: [:a :b | a id <= b id].
319
+ %
320
+ category: 'accessors'
321
+ set compile_env: 0
322
+ method: Statmonitor
323
+ processWithPid: anInteger
324
+
325
+ ^self processes
326
+ detect: [:each | each processID == anInteger]
327
+ ifNone: [nil].
328
+ %
329
+ category: 'initialize'
330
+ set compile_env: 0
331
+ method: Statmonitor
332
+ readData
333
+
334
+ | i |
335
+ i := 0.
336
+ [
337
+ self atEnd not.
338
+ ] whileTrue: [
339
+ | list |
340
+ (i := i + 1) \\ 500 == 0 ifTrue: [self commit].
341
+ i \\ 100 == 0 ifTrue: [Processor yield].
342
+ (list := self nextRow) notEmpty ifTrue: [
343
+ (processTypes at: list first) summarizeLine: list.
344
+ ].
345
+ ].
346
+ %
347
+ category: 'initialize'
348
+ set compile_env: 0
349
+ method: Statmonitor
350
+ readHeader
351
+
352
+ | line list flag |
353
+ level := self headerAt: 'STATMON'.
354
+ platform := self headerAt: 'Platform'.
355
+ gemStoneVersion := self headerAt: 'GemStoneVersion'.
356
+ machine := self headerAt: 'Machine'.
357
+ time := self headerAt: 'Time'.
358
+ (line := self nextLine) = 'StatTypes = [' ifFalse: [self error: 'StatTypes not found'].
359
+ list := (self upTo: $]) subStrings: $,.
360
+ flag := self atEnd.
361
+ list := list reject: [:each | each isEmpty].
362
+ list := list collect: [:each |
363
+ StatProcessType
364
+ fromString: each
365
+ statmon: self.
366
+ ].
367
+ processTypes := Dictionary new.
368
+ list do: [:each |
369
+ processTypes
370
+ at: each id
371
+ put: each.
372
+ ].
373
+ self
374
+ nextLine; "]"
375
+ nextLine; "%%%%Generated by the statistics monitor"
376
+ nextLine; "ENDHEADER"
377
+ yourself.
378
+ %
379
+ category: 'public'
380
+ set compile_env: 0
381
+ method: Statmonitor
382
+ remove
383
+
384
+ self class remove: self.
385
+
386
+ %
387
+ category: 'private'
388
+ set compile_env: 0
389
+ method: Statmonitor
390
+ sanitize
391
+
392
+ path := path copyFrom: path size - 20 to: path size.
393
+ machine := 'hamburg sun4u (Solaris 2.9 Generic_118558-28)'.
394
+ time := (time copyFrom: 1 to: 25) , 'PST'.
395
+ processTypes do: [:each | each sanitize].
396
+ %
397
+ category: 'accessors'
398
+ set compile_env: 0
399
+ method: Statmonitor
400
+ sharedPageCacheMonitor
401
+
402
+ ^(processTypes detect: [:each | each isSharedPageCacheMonitor]) processes first.
403
+ %
404
+ category: 'accessors'
405
+ set compile_env: 0
406
+ method: Statmonitor
407
+ stone
408
+
409
+ ^(processTypes detect: [:each | each isStone]) processes first.
410
+ %
411
+ category: 'initialize'
412
+ set compile_env: 0
413
+ method: Statmonitor
414
+ stream
415
+
416
+ ^SessionTemps current at: #'Statmonitor-stream'.
417
+ %
418
+ category: 'initialize'
419
+ set compile_env: 0
420
+ method: Statmonitor
421
+ stream: aStream
422
+
423
+ SessionTemps current
424
+ at: #'Statmonitor-stream'
425
+ put: aStream.
426
+ %
427
+ category: 'initialize'
428
+ set compile_env: 0
429
+ method: Statmonitor
430
+ streamCache
431
+
432
+ ^SessionTemps current
433
+ at: #'Statmonitor-streamCache'
434
+ ifAbsentPut: [String new].
435
+ %
436
+ category: 'accessors'
437
+ set compile_env: 0
438
+ method: Statmonitor
439
+ time
440
+
441
+ ^time.
442
+
443
+ %
444
+ category: 'public'
445
+ set compile_env: 0
446
+ method: Statmonitor
447
+ timeStampFromSeconds: anInteger
448
+
449
+ ^DateAndTime
450
+ posixSeconds: anInteger
451
+ offset: (Duration seconds: self timeZoneOffset).
452
+ %
453
+ category: 'accessors'
454
+ set compile_env: 0
455
+ method: Statmonitor
456
+ timeZoneOffset
457
+
458
+ | code |
459
+ code := time copyFrom: time size - 2 to: time size.
460
+ code = 'ART' ifTrue: [^-10800]. "3 hours"
461
+ ^-28800 "8 hours"
462
+ %
463
+ category: 'initialize'
464
+ set compile_env: 0
465
+ method: Statmonitor
466
+ upTo: aCharacter
467
+
468
+ | cache i result stream |
469
+ cache := self streamCache.
470
+ 0 < (i := cache indexOf: aCharacter) ifTrue: [
471
+ result := cache copyFrom: 1 to: i - 1.
472
+ i == cache size ifTrue: [
473
+ cache size: 0.
474
+ ] ifFalse: [
475
+ cache copyFrom: i + 1 to: cache size into: cache startingAt: 1.
476
+ cache size: cache size - i.
477
+ ].
478
+ ^result.
479
+ ].
480
+ (stream := self stream) atEnd ifTrue: [
481
+ result := cache copy.
482
+ cache size: 0.
483
+ ^result.
484
+ ].
485
+ cache addAll: (stream next: 15000).
486
+ ^self upTo: aCharacter.
487
+ %
488
+ doit
489
+ Statmonitor category: 'Statmonitor'
490
+ %