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.
- data/README.rdoc +38 -29
- data/bin/webtools +22 -1
- data/lib/web_tools/code_browser.rb +156 -0
- data/lib/web_tools/debugger.rb +96 -199
- data/lib/web_tools/info.rb +1 -3
- data/lib/web_tools/method_list.rb +67 -0
- data/lib/web_tools/middleware/debugger.rb +10 -16
- data/lib/web_tools/object_log.rb +24 -0
- data/lib/web_tools/session_list.rb +119 -0
- data/lib/web_tools/shared_page_cache.rb +30 -0
- data/lib/web_tools/stat_process.rb +24 -0
- data/lib/web_tools/statistics.rb +14 -0
- data/lib/web_tools/support/app_model.rb +66 -101
- data/lib/web_tools/support/code_browser.rb +88 -86
- data/lib/web_tools/support/debugger.rb +303 -0
- data/lib/web_tools/support/error_log.rb +33 -0
- data/lib/web_tools/support/ruby.rb +60 -121
- data/lib/web_tools/support/service_helper.rb +38 -10
- data/lib/web_tools/support/smalltalk_extensions.rb +12 -0
- data/lib/web_tools/tool.rb +48 -0
- data/lib/web_tools/ui.rb +14 -53
- data/lib/web_tools/version_report.rb +29 -0
- data/lib/web_tools/workspace.rb +77 -0
- data/lib/web_tools.rb +14 -4
- data/public/CodeBrowser.html +51 -0
- data/public/CodeMirror/LICENSE +19 -0
- data/public/CodeMirror/css/codemirror.css +67 -0
- data/public/CodeMirror/css/default.css +18 -0
- data/public/CodeMirror/js/codemirror.js +2131 -0
- data/public/CodeMirror/js/ruby.js +195 -0
- data/public/CodeMirror/js/smalltalk.js +139 -0
- data/public/Debugger.html +28 -0
- data/public/MethodList.html +20 -0
- data/public/ObjectLog.html +20 -0
- data/public/SessionList.html +31 -0
- data/public/SharedPageCache.html +78 -0
- data/public/Statistics.html +64 -0
- data/public/VersionReport.html +50 -0
- data/public/Workspace.html +39 -0
- data/public/css/CodeBrowser.css +24 -0
- data/public/css/Debugger.css +32 -0
- data/public/css/MethodList.css +8 -0
- data/public/css/ObjectLog.css +5 -0
- data/public/css/SessionList.css +9 -0
- data/public/css/Statistics.css +24 -0
- data/public/{stylesheets → css}/base/images/ui-anim_basic_16x16.gif +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-icons_222222_256x240.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-icons_454545_256x240.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-icons_888888_256x240.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.accordion.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.all.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.autocomplete.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.base.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.button.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.core.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.datepicker.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.dialog.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.progressbar.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.resizable.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.selectable.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.slider.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.tabs.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.theme.css +0 -0
- data/public/css/editor.css +25 -0
- data/public/css/jjmenu.css +33 -0
- data/public/css/menuitem.gif +0 -0
- data/public/css/more.gif +0 -0
- data/public/{stylesheets → css}/reset.css +1 -1
- data/public/css/smoothness/images/ui-anim_basic_16x16.gif +0 -0
- data/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/public/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/public/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/css/smoothness/jquery-ui.css +489 -0
- data/public/css/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
- data/public/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/public/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/public/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/public/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/public/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/css/ui-lightness/jquery-ui.css +489 -0
- data/public/css/webtools.css +65 -0
- data/public/favicon.ico +0 -0
- data/public/flot/API.txt +1201 -0
- data/public/flot/FAQ.txt +76 -0
- data/public/flot/LICENSE.txt +22 -0
- data/public/flot/Makefile +9 -0
- data/public/flot/NEWS.txt +508 -0
- data/public/flot/PLUGINS.txt +137 -0
- data/public/flot/README.txt +90 -0
- data/public/flot/examples/ajax.html +143 -0
- data/public/flot/examples/annotating.html +75 -0
- data/public/flot/examples/arrow-down.gif +0 -0
- data/public/flot/examples/arrow-left.gif +0 -0
- data/public/flot/examples/arrow-right.gif +0 -0
- data/public/flot/examples/arrow-up.gif +0 -0
- data/public/flot/examples/basic.html +38 -0
- data/public/flot/examples/data-eu-gdp-growth-1.json +4 -0
- data/public/flot/examples/data-eu-gdp-growth-2.json +4 -0
- data/public/flot/examples/data-eu-gdp-growth-3.json +4 -0
- data/public/flot/examples/data-eu-gdp-growth-4.json +4 -0
- data/public/flot/examples/data-eu-gdp-growth-5.json +4 -0
- data/public/flot/examples/data-eu-gdp-growth.json +4 -0
- data/public/flot/examples/data-japan-gdp-growth.json +4 -0
- data/public/flot/examples/data-usa-gdp-growth.json +4 -0
- data/public/flot/examples/graph-types.html +75 -0
- data/public/flot/examples/hs-2004-27-a-large_web.jpg +0 -0
- data/public/flot/examples/image.html +45 -0
- data/public/flot/examples/index.html +44 -0
- data/public/flot/examples/interacting-axes.html +97 -0
- data/public/flot/examples/interacting.html +93 -0
- data/public/flot/examples/layout.css +6 -0
- data/public/flot/examples/multiple-axes.html +60 -0
- data/public/flot/examples/navigate.html +118 -0
- data/public/flot/examples/percentiles.html +57 -0
- data/public/flot/examples/pie.html +756 -0
- data/public/flot/examples/realtime.html +83 -0
- data/public/flot/examples/resize.html +61 -0
- data/public/flot/examples/selection.html +114 -0
- data/public/flot/examples/setting-options.html +61 -0
- data/public/flot/examples/stacking.html +77 -0
- data/public/flot/examples/symbols.html +49 -0
- data/public/flot/examples/thresholding.html +54 -0
- data/public/flot/examples/time.html +71 -0
- data/public/flot/examples/tracking.html +95 -0
- data/public/flot/examples/turning-series.html +98 -0
- data/public/flot/examples/visitors.html +90 -0
- data/public/flot/examples/zooming.html +98 -0
- data/public/flot/excanvas.js +1427 -0
- data/public/flot/excanvas.min.js +1 -0
- data/public/flot/jquery.colorhelpers.js +179 -0
- data/public/flot/jquery.colorhelpers.min.js +1 -0
- data/public/flot/jquery.flot.crosshair.js +167 -0
- data/public/flot/jquery.flot.crosshair.min.js +1 -0
- data/public/flot/jquery.flot.fillbetween.js +183 -0
- data/public/flot/jquery.flot.fillbetween.min.js +1 -0
- data/public/flot/jquery.flot.image.js +238 -0
- data/public/flot/jquery.flot.image.min.js +1 -0
- data/public/flot/jquery.flot.js +2599 -0
- data/public/flot/jquery.flot.min.js +6 -0
- data/public/flot/jquery.flot.navigate.js +336 -0
- data/public/flot/jquery.flot.navigate.min.js +1 -0
- data/public/flot/jquery.flot.pie.js +750 -0
- data/public/flot/jquery.flot.pie.min.js +1 -0
- data/public/flot/jquery.flot.resize.js +60 -0
- data/public/flot/jquery.flot.resize.min.js +1 -0
- data/public/flot/jquery.flot.selection.js +344 -0
- data/public/flot/jquery.flot.selection.min.js +1 -0
- data/public/flot/jquery.flot.stack.js +184 -0
- data/public/flot/jquery.flot.stack.min.js +1 -0
- data/public/flot/jquery.flot.symbol.js +70 -0
- data/public/flot/jquery.flot.symbol.min.js +1 -0
- data/public/flot/jquery.flot.threshold.js +103 -0
- data/public/flot/jquery.flot.threshold.min.js +1 -0
- data/public/flot/jquery.js +8316 -0
- data/public/flot/jquery.min.js +23 -0
- data/public/genPacking.pl +30 -0
- data/public/index.html +28 -0
- data/public/install.tpz +66 -0
- data/public/installAndRun.tpz +5 -0
- data/public/jsTree/jquery.jstree.js +3510 -0
- data/public/jsTree/themes/default/d.gif +0 -0
- data/public/jsTree/themes/default/d.png +0 -0
- data/public/jsTree/themes/default/style.css +73 -0
- data/public/jsTree/themes/default/throbber.gif +0 -0
- data/public/readMe.txt +9 -0
- data/public/scripts/CodeBrowser.js +645 -0
- data/public/scripts/Debugger.js +134 -0
- data/public/scripts/MethodList.js +72 -0
- data/public/scripts/ObjectLog.js +59 -0
- data/public/scripts/SessionList.js +164 -0
- data/public/scripts/Statistics.js +266 -0
- data/public/scripts/editor.js +430 -0
- data/public/scripts/jjmenu.js +375 -0
- data/public/scripts/jquery-ui.js +1012 -0
- data/public/scripts/jquery.js +154 -0
- data/public/scripts/webtools.js +374 -0
- data/public/src/CodeBrowser.gs +416 -0
- data/public/src/Debugger.gs +132 -0
- data/public/src/MethodList.gs +130 -0
- data/public/src/ObjectLog.gs +73 -0
- data/public/src/Server.gs +544 -0
- data/public/src/SessionList.gs +172 -0
- data/public/src/SharedPageCache.gs +66 -0
- data/public/src/StatProcess.gs +280 -0
- data/public/src/StatProcessType.gs +242 -0
- data/public/src/StatStatistic.gs +381 -0
- data/public/src/Statistics.gs +222 -0
- data/public/src/Statmonitor.gs +490 -0
- data/public/src/Tool.gs +86 -0
- data/public/src/VersionReport.gs +52 -0
- data/public/src/Workspace.gs +163 -0
- data/views/debugger.rhtml +6 -9
- metadata +344 -243
- data/lib/web_tools/#debugger.rb# +0 -212
- data/lib/web_tools/browser.rb +0 -45
- data/public/images/favicon.ico +0 -0
- data/public/javascript/CodeMirror/LICENSE +0 -23
- data/public/javascript/CodeMirror/css/Smalltalk.css +0 -34
- data/public/javascript/CodeMirror/js/codemirror.js +0 -582
- data/public/javascript/CodeMirror/js/editor.js +0 -1671
- data/public/javascript/CodeMirror/js/highlight.js +0 -68
- data/public/javascript/CodeMirror/js/parseSmalltalk.js +0 -126
- data/public/javascript/CodeMirror/js/parsedummy.js +0 -32
- data/public/javascript/CodeMirror/js/select.js +0 -699
- data/public/javascript/CodeMirror/js/stringstream.js +0 -159
- data/public/javascript/CodeMirror/js/tokenize.js +0 -57
- data/public/javascript/CodeMirror/js/undo.js +0 -413
- data/public/javascript/CodeMirror/js/util.js +0 -133
- data/public/javascript/CodeMirror/testSmalltalkParser.html +0 -116
- data/public/javascript/ace/ace-uncompressed.js +0 -17299
- data/public/javascript/ace/ace.js +0 -1
- data/public/javascript/ace/keybinding-emacs.js +0 -1
- data/public/javascript/ace/keybinding-vim.js +0 -1
- data/public/javascript/ace/mode-c_cpp.js +0 -1
- data/public/javascript/ace/mode-clojure.js +0 -1
- data/public/javascript/ace/mode-coffee.js +0 -1
- data/public/javascript/ace/mode-csharp.js +0 -1
- data/public/javascript/ace/mode-css.js +0 -1
- data/public/javascript/ace/mode-groovy.js +0 -1
- data/public/javascript/ace/mode-html.js +0 -1
- data/public/javascript/ace/mode-java.js +0 -1
- data/public/javascript/ace/mode-javascript.js +0 -1
- data/public/javascript/ace/mode-json.js +0 -1
- data/public/javascript/ace/mode-lua.js +0 -1
- data/public/javascript/ace/mode-markdown.js +0 -1
- data/public/javascript/ace/mode-ocaml.js +0 -1
- data/public/javascript/ace/mode-perl.js +0 -1
- data/public/javascript/ace/mode-php.js +0 -1
- data/public/javascript/ace/mode-python.js +0 -1
- data/public/javascript/ace/mode-ruby.js +0 -1
- data/public/javascript/ace/mode-scad.js +0 -1
- data/public/javascript/ace/mode-scala.js +0 -1
- data/public/javascript/ace/mode-scss.js +0 -1
- data/public/javascript/ace/mode-svg.js +0 -1
- data/public/javascript/ace/mode-textile.js +0 -1
- data/public/javascript/ace/mode-xml.js +0 -1
- data/public/javascript/ace/theme-clouds.js +0 -1
- data/public/javascript/ace/theme-clouds_midnight.js +0 -1
- data/public/javascript/ace/theme-cobalt.js +0 -1
- data/public/javascript/ace/theme-crimson_editor.js +0 -1
- data/public/javascript/ace/theme-dawn.js +0 -1
- data/public/javascript/ace/theme-eclipse.js +0 -1
- data/public/javascript/ace/theme-idle_fingers.js +0 -1
- data/public/javascript/ace/theme-kr_theme.js +0 -1
- data/public/javascript/ace/theme-merbivore.js +0 -1
- data/public/javascript/ace/theme-merbivore_soft.js +0 -1
- data/public/javascript/ace/theme-mono_industrial.js +0 -1
- data/public/javascript/ace/theme-monokai.js +0 -1
- data/public/javascript/ace/theme-pastel_on_dark.js +0 -1
- data/public/javascript/ace/theme-solarized_dark.js +0 -1
- data/public/javascript/ace/theme-solarized_light.js +0 -1
- data/public/javascript/ace/theme-textmate.js +0 -1
- data/public/javascript/ace/theme-twilight.js +0 -1
- data/public/javascript/ace/theme-vibrant_ink.js +0 -1
- data/public/javascript/ace/worker-coffee.js +0 -1
- data/public/javascript/ace/worker-css.js +0 -1
- data/public/javascript/ace/worker-javascript.js +0 -1
- data/public/javascript/webtools/browser.js +0 -260
- data/public/javascript/webtools/debugger.coffee +0 -286
- data/public/javascript/webtools/debugger.js +0 -366
- data/public/javascript/webtools/sessions.coffee +0 -17
- data/public/javascript/webtools/sessions.js +0 -27
- data/public/javascript/webtools/version.coffee +0 -14
- data/public/javascript/webtools/version.js +0 -20
- data/public/stylesheets/jquery.contextMenu.css +0 -62
- data/public/stylesheets/webtools.css +0 -53
- data/public/test.html +0 -47
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
GemStone.saveScript('scripts/Debugger.js', function(oop) {
|
|
2
|
+
var $tabPanel
|
|
3
|
+
, editor
|
|
4
|
+
, errorElement
|
|
5
|
+
;
|
|
6
|
+
GemStone.loadCSS('css/Debugger.css');
|
|
7
|
+
GemStone.addTab({
|
|
8
|
+
id: 'newTab'
|
|
9
|
+
, label: 'Debugger'
|
|
10
|
+
, title: 'Debugger'
|
|
11
|
+
, onAdd: onAdd
|
|
12
|
+
});
|
|
13
|
+
return;
|
|
14
|
+
|
|
15
|
+
function onAdd(tabPanel) {
|
|
16
|
+
$tabPanel = tabPanel;
|
|
17
|
+
setupEditor();
|
|
18
|
+
$('button.restart', $tabPanel).click(function() { restart(); });
|
|
19
|
+
$('button.into', $tabPanel).click(function() { step(-1); });
|
|
20
|
+
$('button.over', $tabPanel).click(function() { step(0 ); });
|
|
21
|
+
$('button.out', $tabPanel).click( function() { step(1 ); });
|
|
22
|
+
$('button.go', $tabPanel).click( function() { step( ); });
|
|
23
|
+
GemStone.ajax('GET','Debugger', { oop: oop }, gotData);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function setupEditor() {
|
|
27
|
+
GemStone.runJs(
|
|
28
|
+
'scripts/editor.js'
|
|
29
|
+
, {
|
|
30
|
+
editArea: $('.editArea', $tabPanel)
|
|
31
|
+
}
|
|
32
|
+
, function(object) { editor = object; }
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function gotData(data) {
|
|
37
|
+
// console.log(data);
|
|
38
|
+
var items = new Array();
|
|
39
|
+
$('.label', $tabPanel).text(data.label ? data.label : '');
|
|
40
|
+
if (!data.stack) { return; }
|
|
41
|
+
$.each(data.stack, function(index, value){
|
|
42
|
+
items.push('<div class="clickable frame frame');
|
|
43
|
+
items.push(index + 1);
|
|
44
|
+
items.push('" title="');
|
|
45
|
+
items.push(value);
|
|
46
|
+
items.push('">');
|
|
47
|
+
items.push(value);
|
|
48
|
+
items.push('</div>');
|
|
49
|
+
});
|
|
50
|
+
$('.stack', $tabPanel)
|
|
51
|
+
.empty()
|
|
52
|
+
.append(items.join(''));
|
|
53
|
+
$('.stack', $tabPanel).scrollTop(0);
|
|
54
|
+
$('.stack .clickable', $tabPanel).click(clickedOnFrame);
|
|
55
|
+
$('.variableValue', $tabPanel).text('');
|
|
56
|
+
$('.stack .clickable', $tabPanel).first().click();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function clickedOnFrame() {
|
|
60
|
+
$('.stack .frame', $tabPanel).removeClass('selected');
|
|
61
|
+
$(this).addClass('selected');
|
|
62
|
+
var myRequest = {
|
|
63
|
+
oop: oop
|
|
64
|
+
, frame: selectedFrame()
|
|
65
|
+
};
|
|
66
|
+
GemStone.ajax('GET', 'Debugger/frame', myRequest, gotFrame);
|
|
67
|
+
$('.variableValue', $tabPanel).text('');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function selectedFrame() {
|
|
71
|
+
return parseInt($('.stack .selected', $tabPanel).attr('class').match(/frame([0-9]+)/)[1]);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function gotFrame(data) {
|
|
75
|
+
// console.log(data);
|
|
76
|
+
$('button', $tabPanel).attr('disabled','');
|
|
77
|
+
if (editor) {
|
|
78
|
+
if (data.method) {
|
|
79
|
+
editor.setMethod(data.method);
|
|
80
|
+
} else {
|
|
81
|
+
editor.setCode();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
var items = new Array();
|
|
85
|
+
$.each(data.variables, function(index, each) {
|
|
86
|
+
items.push('<tr class="clickable">');
|
|
87
|
+
items.push('<td class="name">' + each.name + '</td>');
|
|
88
|
+
items.push('<td class="value" title="');
|
|
89
|
+
items.push(each.string.replace(/["]/g, '\\\"') + '">');
|
|
90
|
+
items.push(each.string.substring(0, 30) + '</td>');
|
|
91
|
+
items.push('<td class="oop">' + each.oop + '</td>');
|
|
92
|
+
items.push('</tr>');
|
|
93
|
+
});
|
|
94
|
+
$('.variables tbody', $tabPanel)
|
|
95
|
+
.empty()
|
|
96
|
+
.append(items.join(''));
|
|
97
|
+
$('.variables', $tabPanel).scrollTop(0);
|
|
98
|
+
$('.variables .clickable', $tabPanel).click(clickedOnVariable);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function clickedOnVariable() {
|
|
102
|
+
$('.variables .clickable', $tabPanel).removeClass('selected');
|
|
103
|
+
$(this).addClass('selected');
|
|
104
|
+
$('.variableValue', $tabPanel).text($('td.value', this).attr('title'));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function step(anInteger) {
|
|
108
|
+
$('button', $tabPanel).attr('disabled','disabled');
|
|
109
|
+
var myRequest = {
|
|
110
|
+
oop: oop
|
|
111
|
+
, level: typeof anInteger === 'number' ? selectedFrame() + anInteger : null
|
|
112
|
+
};
|
|
113
|
+
GemStone.ajax('POST', 'Debugger/step', myRequest, didStep);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function restart() {
|
|
117
|
+
var myRequest = {
|
|
118
|
+
oop: oop
|
|
119
|
+
, frame: selectedFrame()
|
|
120
|
+
};
|
|
121
|
+
GemStone.ajax('POST', 'Debugger/restart', myRequest, didStep);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function didStep(data) {
|
|
125
|
+
console.log(data);
|
|
126
|
+
gotData(data); // will return early if no stack change
|
|
127
|
+
gotFrame(data);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function didGo(data) {
|
|
131
|
+
console.log(data);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
GemStone.saveScript('scripts/MethodList.js', function(search) {
|
|
2
|
+
var $tabPanel
|
|
3
|
+
, editor
|
|
4
|
+
, errorElement
|
|
5
|
+
;
|
|
6
|
+
GemStone.loadCSS('css/MethodList.css');
|
|
7
|
+
GemStone.addTab({
|
|
8
|
+
id: 'newTab'
|
|
9
|
+
, label: search.label
|
|
10
|
+
, title: 'Browse ' + search.label
|
|
11
|
+
, onAdd: onAdd
|
|
12
|
+
});
|
|
13
|
+
return;
|
|
14
|
+
|
|
15
|
+
function onAdd(tabPanel) {
|
|
16
|
+
$tabPanel = tabPanel;
|
|
17
|
+
// $tabPanel.keydown(keydown);
|
|
18
|
+
setupEditor();
|
|
19
|
+
GemStone.ajax('GET','MethodList', search, gotList);
|
|
20
|
+
GemStone.scroll($('.methodList', $tabPanel));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function setupEditor() {
|
|
24
|
+
GemStone.runJs(
|
|
25
|
+
'scripts/editor.js'
|
|
26
|
+
, {
|
|
27
|
+
editArea: $('.editArea', $tabPanel)
|
|
28
|
+
}
|
|
29
|
+
, function(object) { editor = object; }
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function gotList(data) {
|
|
34
|
+
// console.log(data);
|
|
35
|
+
var items = [];
|
|
36
|
+
if (!data.list) { return; }
|
|
37
|
+
$.each(data.list, function(index, value){
|
|
38
|
+
items.push('<tr class="clickable method">');
|
|
39
|
+
items.push('<td class="dict" title="' + GemStone.encodeHTML(value.dict) + '">' + value.dict + '</td>');
|
|
40
|
+
items.push('<td class="klassCat" title="' + GemStone.encodeHTML(value.klassCat) + '">' + value.klassCat + '</td>');
|
|
41
|
+
items.push('<td class="klass" title="' + GemStone.encodeHTML(value.klass) + '">' + value.klass + '</td>');
|
|
42
|
+
items.push('<td class="category" title="' + GemStone.encodeHTML(value.category) + '">' + value.category + '</td>');
|
|
43
|
+
items.push('<td class="selector" title="' + GemStone.encodeHTML(value.selector) + '">' + value.selector + '</td></tr>');
|
|
44
|
+
});
|
|
45
|
+
$('.methodList .tableBody tbody', $tabPanel)
|
|
46
|
+
.empty()
|
|
47
|
+
.append(items.join(''));
|
|
48
|
+
$('.methodList .tableBody', $tabPanel).scrollTop(0);
|
|
49
|
+
$('.tableBody tbody .method', $tabPanel).click(clickedOnMethod);
|
|
50
|
+
$(window).resize(); // force resize to update column widths
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function clickedOnMethod(event) {
|
|
54
|
+
var myRequest = {
|
|
55
|
+
type: 'method'
|
|
56
|
+
, dict: encodeURI($('.dict', $(this)).text())
|
|
57
|
+
, klass: encodeURI($('.klass', $(this)).text())
|
|
58
|
+
, selector: encodeURI($('.selector', $(this)).text())
|
|
59
|
+
};
|
|
60
|
+
$('.methodList .method', $tabPanel).removeClass('selected');
|
|
61
|
+
$(this).addClass('selected');
|
|
62
|
+
// console.log(myRequest);
|
|
63
|
+
GemStone.ajax('GET','MethodList', myRequest, gotMethod);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function gotMethod(data) {
|
|
67
|
+
if (editor) {
|
|
68
|
+
editor.setMethod(data);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
GemStone.saveScript('scripts/ObjectLog.js', function() {
|
|
2
|
+
var $tabPanel
|
|
3
|
+
;
|
|
4
|
+
GemStone.loadCSS('css/ObjectLog.css');
|
|
5
|
+
GemStone.addTab({
|
|
6
|
+
id: 'newTab'
|
|
7
|
+
, label: 'Object Log'
|
|
8
|
+
, title: 'Object Log'
|
|
9
|
+
, onAdd: onAdd
|
|
10
|
+
});
|
|
11
|
+
return;
|
|
12
|
+
|
|
13
|
+
function onAdd(tabPanel) {
|
|
14
|
+
$tabPanel = tabPanel;
|
|
15
|
+
GemStone.ajax('GET','ObjectLog', {}, gotList);
|
|
16
|
+
GemStone.scroll($('.objectLog', $tabPanel));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function gotList(data) {
|
|
20
|
+
var items = new Array();
|
|
21
|
+
if (!data.list) { return; }
|
|
22
|
+
$.each(data.list, function(index, value){
|
|
23
|
+
items.push('<tr class="clickable" title="' + value.oop + '">');
|
|
24
|
+
items.push('<td class="stamp" title="' + value.stamp + '">' + value.stamp + '</td>');
|
|
25
|
+
items.push('<td class="pid" title="' + value.pid + '">' + value.pid + '</td>');
|
|
26
|
+
items.push('<td class="label" title="' + value.label + '">' + value.label + '</td>');
|
|
27
|
+
items.push('<td class="type" title="' + value.type + '">' + value.type + '</td>');
|
|
28
|
+
items.push('<td class="tag" title="' + value.tag + '">' + value.tag + '</td>');
|
|
29
|
+
items.push('<td class="object" title="' + value.object + '">' + value.object.substring(0,50) + '</td>');
|
|
30
|
+
items.push('<td class="stack" title="' + (value.hasContinuation ? 'Click to debug continuation' : '') + '">' + (value.hasContinuation ? 'Yes' : '') + '</td>');
|
|
31
|
+
items.push('</tr>');
|
|
32
|
+
});
|
|
33
|
+
$('.objectLog .tableBody tbody', $tabPanel)
|
|
34
|
+
.empty()
|
|
35
|
+
.append(items.join(''));
|
|
36
|
+
$('.objectLog .tableBody', $tabPanel).scrollTop(0);
|
|
37
|
+
$('.objectLog .tableBody tbody tr', $tabPanel).click(clickedOnEntry);
|
|
38
|
+
$(window).resize(); // force resize to update column widths
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function clickedOnEntry(event) {
|
|
42
|
+
if (0 < $('td.stack', this).text().length) {
|
|
43
|
+
if (confirm($('td.object', this).attr('title') + '\n\nDebug continuation?')) {
|
|
44
|
+
var oop = $(this).attr('title');
|
|
45
|
+
GemStone.ajax(
|
|
46
|
+
'GET'
|
|
47
|
+
, 'Debugger.html'
|
|
48
|
+
, null
|
|
49
|
+
, function(html) {
|
|
50
|
+
var string = html.replace('OOP', oop);
|
|
51
|
+
$('body').append(string);
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
alert($('td.object', this).attr('title'));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
GemStone.saveScript('scripts/SessionList.js', function() {
|
|
2
|
+
var $tabPanel
|
|
3
|
+
;
|
|
4
|
+
GemStone.loadCSS('css/SessionList.css');
|
|
5
|
+
GemStone.addTab({
|
|
6
|
+
id: 'newTab'
|
|
7
|
+
, label: 'Sessions'
|
|
8
|
+
, title: 'Information on Gems and other OS processes'
|
|
9
|
+
, onAdd: onAdd
|
|
10
|
+
});
|
|
11
|
+
return;
|
|
12
|
+
|
|
13
|
+
function onAdd(tabPanel) {
|
|
14
|
+
$tabPanel = tabPanel;
|
|
15
|
+
GemStone.scroll($('.gemList', $tabPanel));
|
|
16
|
+
GemStone.ajax('GET', 'SessionList', null, gotData);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function gotData(json) {
|
|
20
|
+
var names = $.map(json.labels, function(each) { return each.key; })
|
|
21
|
+
, slotIndex = names.indexOf('Slot')
|
|
22
|
+
, hostIndex = names.indexOf('Host ID')
|
|
23
|
+
;
|
|
24
|
+
buildHeader();
|
|
25
|
+
buildData();
|
|
26
|
+
$(window).resize(); // force resize to update column widths
|
|
27
|
+
buildStoneList();
|
|
28
|
+
$('.slot', $tabPanel).click(showStats);
|
|
29
|
+
|
|
30
|
+
function buildHeader() {
|
|
31
|
+
var items = [];
|
|
32
|
+
$.each(json.labels, function() {
|
|
33
|
+
if ('Host ID' !== this.key) {
|
|
34
|
+
items.push('<th title="' + this.value + '">' + this.key + '</th>');
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
var html = items.join('');
|
|
38
|
+
$('thead tr', $tabPanel).empty().append(html);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function buildData() {
|
|
42
|
+
var items = [];
|
|
43
|
+
$.each(json.sessions, function(index, sessionInfo) {
|
|
44
|
+
var slot = sessionInfo[slotIndex]
|
|
45
|
+
, classes = 'slot clickable';
|
|
46
|
+
items.push('<tr');
|
|
47
|
+
if (slot) {
|
|
48
|
+
items.push(' title="Click to see cache statistics for slot ');
|
|
49
|
+
items.push(slot + '"');
|
|
50
|
+
classes = classes + ' slot' + slot;
|
|
51
|
+
}
|
|
52
|
+
items.push(' class="' + classes + '">');
|
|
53
|
+
$.each(sessionInfo, function(index, field) {
|
|
54
|
+
if (index !== hostIndex) {
|
|
55
|
+
var x = (field + '').match(/(\d+)(s)/);
|
|
56
|
+
items.push('<td>');
|
|
57
|
+
if (x) {
|
|
58
|
+
var
|
|
59
|
+
sec = x[1]
|
|
60
|
+
, min = Math.floor(sec / 60)
|
|
61
|
+
, hrs = Math.floor(min / 60)
|
|
62
|
+
, dys = Math.floor(hrs / 24)
|
|
63
|
+
;
|
|
64
|
+
if (1 < dys) {
|
|
65
|
+
items.push(dys + 'd');
|
|
66
|
+
} else if (1 < hrs) {
|
|
67
|
+
items.push(hrs + 'h');
|
|
68
|
+
} else if (1 < min) {
|
|
69
|
+
items.push(min + 'm');
|
|
70
|
+
}else {
|
|
71
|
+
items.push(sec + 's');
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
items.push(field);
|
|
75
|
+
}
|
|
76
|
+
items.push('</td>');
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
items.push('</tr>');
|
|
80
|
+
});
|
|
81
|
+
$('.gemList .tableBody tbody')
|
|
82
|
+
.empty()
|
|
83
|
+
.append(items.join(''));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function buildStoneList() {
|
|
87
|
+
var items = []
|
|
88
|
+
;
|
|
89
|
+
$.each(json.other, function(index, name) {
|
|
90
|
+
var slotId = 'slot' + name[0];
|
|
91
|
+
items.push('<li');
|
|
92
|
+
items.push(' class="' + (0 == index ? 'first' : 'rest') + '"');
|
|
93
|
+
items.push(' title="Click to see cache statistics for slot ');
|
|
94
|
+
items.push(name[0] + '"');
|
|
95
|
+
items.push('><span class="slot clickable ' + slotId + '"');
|
|
96
|
+
items.push('>' + name[1] + '</span></li>');
|
|
97
|
+
});
|
|
98
|
+
$('.stoneProcesses')
|
|
99
|
+
.empty()
|
|
100
|
+
.append(items.join(''));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function showStats() {
|
|
104
|
+
var slot = $(this).attr('class').match(/slot(\d+)/)[1]
|
|
105
|
+
;
|
|
106
|
+
$('#tabs').append('<div id="newTab" class="statsPanel maximize">'
|
|
107
|
+
+ $('.statsTemplate').html()
|
|
108
|
+
+ '</div>');
|
|
109
|
+
GemStone.addTab({
|
|
110
|
+
id: 'newTab'
|
|
111
|
+
, label: 'Slot ' + slot + ' Stats'
|
|
112
|
+
, title: 'View process statistics from the shared page cache'
|
|
113
|
+
, onAdd: function($tabPanel) { getStats($tabPanel, slot); }
|
|
114
|
+
});
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function getStats($tabPanel, slot) {
|
|
119
|
+
GemStone.scroll($('.stats', $tabPanel));
|
|
120
|
+
GemStone.ajax(
|
|
121
|
+
'GET'
|
|
122
|
+
, 'SessionList/statsForSlot'
|
|
123
|
+
, {'slot' : slot}
|
|
124
|
+
, function(data){ gotStats($tabPanel, slot, data); }
|
|
125
|
+
);
|
|
126
|
+
return;
|
|
127
|
+
|
|
128
|
+
function gotStats($tabPanel, slot, data) {
|
|
129
|
+
var items = [];
|
|
130
|
+
$.each(data.stats, function() {
|
|
131
|
+
items.push('<tr>');
|
|
132
|
+
items.push('<td class="statName">' + this.name + ' ');
|
|
133
|
+
items.push('<a class="descr" href="#">?</a></td>');
|
|
134
|
+
items.push('<td>' + this.type + '</td>');
|
|
135
|
+
items.push('<td>' + this.level + '</td>');
|
|
136
|
+
items.push('<td>' + this.units + '</td>');
|
|
137
|
+
items.push('<td>' + this.isOs + '</td>');
|
|
138
|
+
items.push('<td>' + this.value + '</td>');
|
|
139
|
+
items.push('</tr>');
|
|
140
|
+
});
|
|
141
|
+
$('.tableBody tbody', $tabPanel).empty().append(items.join(''));
|
|
142
|
+
$('.tableBody tbody a.descr', $tabPanel).click(function(event){
|
|
143
|
+
getDescription(event, $(this))
|
|
144
|
+
});
|
|
145
|
+
$(window).resize(); // force resize to update column widths
|
|
146
|
+
return;
|
|
147
|
+
|
|
148
|
+
function getDescription(event, element) {
|
|
149
|
+
var name = $(element).parent().text();
|
|
150
|
+
name = name.substring(0, name.length - 2);
|
|
151
|
+
GemStone.ajax('GET', 'SessionList/cacheDescription',
|
|
152
|
+
{'name' : name}, gotDescription);
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
return;
|
|
155
|
+
|
|
156
|
+
function gotDescription(data) {
|
|
157
|
+
alert(data.description);
|
|
158
|
+
$(element).parent().attr('title', data.description);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
GemStone.saveScript('scripts/Statistics.js', function() {
|
|
2
|
+
var $tabPanel
|
|
3
|
+
;
|
|
4
|
+
GemStone.loadCSS('css/Statistics.css');
|
|
5
|
+
GemStone.runJsOnce('flot/jquery.flot.js', function() {
|
|
6
|
+
GemStone.runJsOnce('flot/jquery.flot.stack.js', function() {
|
|
7
|
+
GemStone.addTab({
|
|
8
|
+
id: 'newTab'
|
|
9
|
+
, label: 'Statistics'
|
|
10
|
+
, title: 'Work with Statmonitor files'
|
|
11
|
+
, onAdd: onAdd
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
return;
|
|
16
|
+
|
|
17
|
+
function onAdd(tabPanel) {
|
|
18
|
+
$tabPanel = tabPanel;
|
|
19
|
+
$('.readFile').click(readFile);
|
|
20
|
+
$('.refresh').click(refresh);
|
|
21
|
+
refresh();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function refresh() {
|
|
25
|
+
GemStone.ajax('GET', 'Statistics', null, gotFiles);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function readFile() {
|
|
29
|
+
$('#readStatmonDialog').dialog({
|
|
30
|
+
buttons: { Read: doRead }
|
|
31
|
+
, modal: true
|
|
32
|
+
, open: function() { $('#statmonPath').focus() }
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function doRead() {
|
|
37
|
+
var data = { path: $('#statmonPath').val() };
|
|
38
|
+
$(this).dialog('close');
|
|
39
|
+
GemStone.ajax('GET', 'Statistics/readFile', data, gotFiles);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
function gotFiles(data) {
|
|
44
|
+
GemStone.scroll($('.statmonFiles', $tabPanel));
|
|
45
|
+
var items = [];
|
|
46
|
+
$('.statmonFiles tbody', $tabPanel).empty();
|
|
47
|
+
$('.statmonProcesses tbody', $tabPanel).empty();
|
|
48
|
+
$('.statmonProcesses', $tabPanel).addClass('hidden');
|
|
49
|
+
$('.statmonStats tbody', $tabPanel).empty();
|
|
50
|
+
$('.statmonStats', $tabPanel).addClass('hidden');
|
|
51
|
+
$.each(data['files'], function() {
|
|
52
|
+
items.push('<tr class="clickable">');
|
|
53
|
+
items.push('<td title="' + this['time'] + '">' + this['time'] + '</td>');
|
|
54
|
+
items.push('<td title="' + this['platform'] + '">' + this['platform'] + '</td>');
|
|
55
|
+
items.push('<td title="' + this['gemStoneVersion'] + '">' + this['gemStoneVersion'] + '</td>');
|
|
56
|
+
items.push('<td title="' + this['machine'] + '">' + this['machine'] + '</td>');
|
|
57
|
+
items.push('<td class="path" title="' + this['path'] + '">' + this['path'] + '</td>');
|
|
58
|
+
items.push('</tr>');
|
|
59
|
+
});
|
|
60
|
+
$('.statmonFiles tbody', $tabPanel).append(items.join(''));
|
|
61
|
+
GemStone.menu({
|
|
62
|
+
selector: $('.statmonFiles tbody tr', $tabPanel)
|
|
63
|
+
, menu: statmonMenu
|
|
64
|
+
});
|
|
65
|
+
$('.statmonFiles tbody tr', $tabPanel).click(showFile);
|
|
66
|
+
$(window).resize(); // force resize to update column widths
|
|
67
|
+
return;
|
|
68
|
+
|
|
69
|
+
function statmonMenu(element) {
|
|
70
|
+
return [
|
|
71
|
+
{ title: 'Remove'
|
|
72
|
+
, action: function() { remove($('td.path', element).text()); }
|
|
73
|
+
}
|
|
74
|
+
, { title: 'SPC Page Types'
|
|
75
|
+
, action: function() { spcPageTypes($('td.path', element).text()); }
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function remove(path) {
|
|
81
|
+
$('div#removeStatmonDialog span.path').text(path);
|
|
82
|
+
$('div#removeStatmonDialog').dialog({
|
|
83
|
+
buttons: {
|
|
84
|
+
Remove: function() { doRemove(path, this); }
|
|
85
|
+
, Cancel: function() { $(this).dialog('close'); }
|
|
86
|
+
}
|
|
87
|
+
, modal: true
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function spcPageTypes(path) {
|
|
92
|
+
GemStone.ajax('GET', 'Statistics/spcPageTypes', { path: path }, gotStastic);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function doRemove(path, dialog) {
|
|
96
|
+
var data = { path: path };
|
|
97
|
+
GemStone.ajax('GET', 'Statistics/removeFile', data, gotFiles);
|
|
98
|
+
$(dialog).dialog('close');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function showFile() {
|
|
102
|
+
$('.statmonFiles tbody tr', $tabPanel).removeClass('selected');
|
|
103
|
+
$(this).addClass('selected');
|
|
104
|
+
var data = {
|
|
105
|
+
path: $('.statmonFiles tbody tr.selected td.path', $tabPanel).text()
|
|
106
|
+
// , filter: $('#statmonFilter option', $tabPanel)
|
|
107
|
+
};
|
|
108
|
+
GemStone.ajax('GET', 'Statistics/processes', data, gotProcesses);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function gotProcesses(data) {
|
|
113
|
+
// console.log(data);
|
|
114
|
+
GemStone.scroll($('.statmonProcesses', $tabPanel));
|
|
115
|
+
$('.statmonProcesses', $tabPanel).removeClass('hidden');
|
|
116
|
+
$('.statmonProcesses tbody', $tabPanel).empty();
|
|
117
|
+
$('.statmonStats tbody', $tabPanel).empty();
|
|
118
|
+
$('.statmonStats', $tabPanel).addClass('hidden');
|
|
119
|
+
/*
|
|
120
|
+
$('#statmonFilter', $tabPanel).empty();
|
|
121
|
+
var items = ['<option></option>'];
|
|
122
|
+
$.each(data['statNames'], function() {
|
|
123
|
+
items.push('<option>' + this + '</option>');
|
|
124
|
+
});
|
|
125
|
+
$('#statmonFilter', $tabPanel).append(items.join(''));
|
|
126
|
+
*/
|
|
127
|
+
var items = [];
|
|
128
|
+
$.each(data['processes'], function() {
|
|
129
|
+
var time = this['start']
|
|
130
|
+
, prim = []
|
|
131
|
+
, crb = 0 < this['crb'] ? this['crb'] : ''
|
|
132
|
+
;
|
|
133
|
+
$.each(this['prim'],function() { prim.push(this); });
|
|
134
|
+
items.push('<tr class="clickable" id="oop' + this['oop'] + '">');
|
|
135
|
+
items.push('<td title="' + time + '">' + time.substring(11, 16) + '</td>');
|
|
136
|
+
items.push('<td class="number">' + this['count'] + '</td>');
|
|
137
|
+
items.push('<td class="number">' + this['pid'] + '</td>');
|
|
138
|
+
items.push('<td class="number">' + this['session'] + '</td>');
|
|
139
|
+
items.push('<td>' + this['type'] + '</td>');
|
|
140
|
+
items.push('<td>' + prim.join(',') + '</td>');
|
|
141
|
+
items.push('<td class="number">' + crb + '</td>');
|
|
142
|
+
items.push('<td>' + this['name'] + '</td>');
|
|
143
|
+
items.push('</tr>');
|
|
144
|
+
});
|
|
145
|
+
$('.statmonProcesses tbody', $tabPanel).append(items.join(''));
|
|
146
|
+
$('.statmonProcesses tbody tr', $tabPanel).click(showProcess);
|
|
147
|
+
$(window).resize(); // force resize to update column widths
|
|
148
|
+
return;
|
|
149
|
+
|
|
150
|
+
function showProcess() {
|
|
151
|
+
$('.statmonProcesses tbody tr', $tabPanel).removeClass('selected');
|
|
152
|
+
$(this).addClass('selected');
|
|
153
|
+
var data = {
|
|
154
|
+
path: $('.statmonFiles tbody tr.selected .path', $tabPanel).text()
|
|
155
|
+
, processOop: this.id.substring(3)
|
|
156
|
+
};
|
|
157
|
+
GemStone.ajax('GET', 'Statistics/process', data, gotProcess);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function gotProcess(data) {
|
|
162
|
+
GemStone.scroll($('.statmonStats', $tabPanel));
|
|
163
|
+
var items = [];
|
|
164
|
+
$('.statmonStats tbody', $tabPanel).empty();
|
|
165
|
+
$('.statmonStats', $tabPanel).removeClass('hidden');
|
|
166
|
+
$.each(data['statistics'], function() {
|
|
167
|
+
var type = this['type']
|
|
168
|
+
, min = this['min']
|
|
169
|
+
, max = this['max']
|
|
170
|
+
, mean = this['mean']
|
|
171
|
+
, rate = this['rate']
|
|
172
|
+
, units = this['units']
|
|
173
|
+
, average
|
|
174
|
+
, title;
|
|
175
|
+
if (units == 'none') units = '';
|
|
176
|
+
if (type == 'counter') {
|
|
177
|
+
min = max = '';
|
|
178
|
+
average = rate;
|
|
179
|
+
title = rate;
|
|
180
|
+
if (0 < average && average < 1) {
|
|
181
|
+
var factor = Math.pow(10, Math.ceil(0 - Math.log(rate) / Math.LN10));
|
|
182
|
+
average = Math.round(average * factor) / factor;
|
|
183
|
+
} else {
|
|
184
|
+
average = Math.round(average);
|
|
185
|
+
}
|
|
186
|
+
if (average != 0 && units == 'milliseconds') {
|
|
187
|
+
average = average / 10; // convert to percent
|
|
188
|
+
var factor = Math.pow(10, Math.ceil(0 - Math.log(average) / Math.LN10));
|
|
189
|
+
average = (Math.round(average * factor) / factor) + '%';
|
|
190
|
+
title = title + ' ms/sec';
|
|
191
|
+
} else {
|
|
192
|
+
average = average + '/sec';
|
|
193
|
+
if (average < 1) {
|
|
194
|
+
title = Math.round(1 / average) + ' seconds between each';
|
|
195
|
+
} else {
|
|
196
|
+
title = title + ' ' + units + '/sec';
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
average = Math.round(mean);
|
|
201
|
+
title = average + ' ' + units;
|
|
202
|
+
}
|
|
203
|
+
items.push('<tr class="clickable" id="oop' + this['oop'] + '">');
|
|
204
|
+
items.push('<td title="' + this['descr']);
|
|
205
|
+
items.push(' (' + type + ':' + units + ')"');
|
|
206
|
+
items.push(' class="name">' + this['name'] + '</td>');
|
|
207
|
+
items.push('<td class="number">' + min + '</td>');
|
|
208
|
+
items.push('<td class="number">' + max + '</td>');
|
|
209
|
+
items.push('<td class="number" title="' + title + '">' + average + '</td>');
|
|
210
|
+
items.push('</tr>');
|
|
211
|
+
});
|
|
212
|
+
$('.statmonStats tbody', $tabPanel).append(items.join(''));
|
|
213
|
+
$('.statmonStats tbody tr', $tabPanel).click(showStatistic);
|
|
214
|
+
$('.statmonStats .tableBody', $tabPanel).scrollTop(0);
|
|
215
|
+
$(window).resize(); // force resize to update column widths
|
|
216
|
+
return;
|
|
217
|
+
|
|
218
|
+
function showStatistic() {
|
|
219
|
+
var data = {
|
|
220
|
+
path: $('.statmonFiles tbody tr.selected .path', $tabPanel).text()
|
|
221
|
+
, processOop: $('.statmonProcesses tbody tr.selected', $tabPanel).attr('id').substring(3)
|
|
222
|
+
, statName: $('.name', this).text()
|
|
223
|
+
};
|
|
224
|
+
GemStone.ajax('GET', 'Statistics/statistic', data, gotStastic);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function gotStastic(data) {
|
|
229
|
+
// console.log(data);
|
|
230
|
+
var name = data['statName']
|
|
231
|
+
, id = name + data['processOop']
|
|
232
|
+
, flotData = data['flotData']
|
|
233
|
+
, options = data['options']
|
|
234
|
+
;
|
|
235
|
+
$('#tabs').append('<div id="' + id + '"'
|
|
236
|
+
+ ' class="statPanel maximize">'
|
|
237
|
+
+ $('#statTemplate').html()
|
|
238
|
+
+ '</div>');
|
|
239
|
+
var $flotDiv = $('#' + id + ' .flot');
|
|
240
|
+
$flotDiv.bind("plothover", function (event, pos, item) {
|
|
241
|
+
if (item) {
|
|
242
|
+
var point = item['datapoint']
|
|
243
|
+
, date = (new Date(point[0] + 28800000)).toString().substr(0,24)
|
|
244
|
+
, value = point[1]
|
|
245
|
+
;
|
|
246
|
+
$flotDiv.attr('title', value + ' at ' + date);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
resize();
|
|
251
|
+
GemStone.addTab({
|
|
252
|
+
id: id
|
|
253
|
+
, label: name
|
|
254
|
+
, title: 'Graph of statistics'
|
|
255
|
+
, onAdd: function(aPanel) { $(aPanel).resize(resize); }
|
|
256
|
+
});
|
|
257
|
+
return;
|
|
258
|
+
|
|
259
|
+
function resize() {
|
|
260
|
+
$flotDiv
|
|
261
|
+
.css('height', $flotDiv.parent().height() - 50)
|
|
262
|
+
.css('width', $flotDiv.parent().width() - 50);
|
|
263
|
+
$.plot($flotDiv, flotData, options);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
});
|