Helma Logo
main list history

Version 3 by hannes on 29. September 2009, 15:52

12    ==================================================================--------------------------------------------------------------------------------
17    166 ms  166 ms      1    gobi-dev/code/Global/WikiMarkup.js #29: #29
19    165 ms  165 ms      1    gobi-dev/code/Global/PageList.js #76: #76
20    98 ms    0 ms  1562    gobi-dev/code/Global/PageList.js #8: #8
24    45 ms    0 ms    103    gobi-dev/code/Global/Permissions.js #8: #8

Version 2 by hannes on 29. September 2009, 09:47

Version 1 by hannes on 29. September 2009, 09:46

1Helma 1.7 and Helma NG feature a profiler for measuring function runtime and invocation frequency. This page describes the Helma 1 profiler. For information on the NG profiler view the [dedicated page][Helma NG/Profiler].
3To enable the profiler, add the following line to the [app.properties] or [server.properties] file:
4
5    rhino.profile = true
6
7Note that for the profiler to work, the application has to run in interpreted mode (rhino optimization level set to -1). If the `rhino.profile` property is set, this is taken care of automatically, but you have to start (or restart) the application with this setting - enabling the profiler at runtime will not work.
8
9By default, the profiler will be used for all requests and internal invocations. The output is written to the application's event log and, if available, to the response's debug area. It looks like this:
10
11    total  average  calls    path
12    ==================================================================
13    234 ms  234 ms      1    gobi-dev/code/Page/PageActions.js #220: create_action
14    205 ms  205 ms      1    gobi-dev/code/HopObject/macros.js #8: skin_macro
15    169 ms  169 ms      1    gobi-dev/code/Global/Global.js #495: include_macro
16    166 ms  166 ms      1    gobi-dev/code/Page/PageMacros.js #8: body_macro
17    166 ms  166 ms      1    gobi-dev/code/Global/WikiMarkup.js #29:
18    166 ms  166 ms      1    gobi-dev/code/Page/PageMacros.js #330: list_macro
19    165 ms  165 ms      1    gobi-dev/code/Global/PageList.js #76:
20    98 ms    0 ms  1562    gobi-dev/code/Global/PageList.js #8:
21    92 ms    0 ms    105    gobi-dev/code/Page/Permissions.js #152: checkAccess
22    58 ms    0 ms    578    gobi-dev/code/Page/PageCore.js #343: getLink
23    48 ms    0 ms    104    gobi-dev/code/Page/Permissions.js #173: getPermission
24    46 ms    0 ms    103    gobi-dev/code/Page/Permissions.js #169: getPermissions
25    45 ms    0 ms    103    gobi-dev/code/Global/Permissions.js #8:
26    <truncated>
27
28In order to only apply the profiler to requests for one particular user, set the `rhino.profile.session` property to the user's session id (the value of the user's HopSession cookie).
29
30    rhino.profile = true
31    rhino.profile.session = 127.0.0.1n5guagu2sdl2jslf
32
33This allows you to use the debugger in production environments and only profile your own requests. Note that the application still needs to run in interpreted mode for everybody, though, but this usually won't have a huge impact on performance.
34
35It's also possible to set the `rhino.profile.session` property so that it matches a substring of the session id. Since Helma session ids are prefixed with the user's IP address by default, this can be useful to only profile requests from a specific IP address or subnet. For example, the following setting will will cause only requests from the `192.168.0.0/255.255.255.0` subnet to be profiled.
36
37    rhino.profile = true
38    rhino.profile.session = 192.168.0
39
40Be careful when running Helma in a local reverse proxy setup, though, as all sessions may be prefixed with 127.0.0.1 or an address from your LAN.