For a quick start, there are some default configuration files, which you can download with the installation. You can set the reference to one of this files with the ConfigFile property on the Java command line:
-Xrunsherlok:ConfigFile=sherlok.properties
Another way to choose configuration files is to specify the ConfigPath and select all files ending with *.skp. You can choose one of the configuration files with the set command in the console or with the drop down box of the user interface.
-Xrunsherlok:ConfigPath=/usr/sap/sherlok
The following table gives an overview over the properties. For the first go its not necessary to modify any value of the defaults, but as expert you can gain more information about a running application with the right settings.
Property | Description | Type |
ProfileInfo | Display information | String |
ProfileStart | Automatic startup | yes | [no] |
ProfileMode | Profiler mode | [profile] | interrupt |
ProfileScope | Static scope of the profiler | Comma separated list of classes |
ProfilePackages | Packages in scope to add to the profiler | Comma separated list of classes |
ProfileExcludes | Packages to exclude from profiler | Comma separated list of classes |
ProfileHide | Packages to hide from output | Comma separated list of classes |
ProfileMethods | Methods in scope to add to the profiler | Comma separated list of methods |
ProfileMemory | Profile memory not in scope | [on] | off | all |
ProfileLimitOutput | Maximum number of lines for any command | integer number [2000] |
ProfileLimitHash | Maximum number of elements in internal hash table | integer number |
Timer | Activate timer for all methods | on | [off] |
TimerMethods | Activate timer for specific method | Semicolon separated list of methods |
TraceMethods | Methods to add to the tracer | Comma separated list of methods |
TraceTrigger | Method to act as trigger | Method name |
TraceCallstack | Method to add to stack tracer | Method name |
TelnetPort | Telnet port for console | Integer number |
TelnetHost | Telnet host for console | Hostname [localhost] |
You can use wildcards in package and method names. A dot at the start is a wildcard for the begin of the name, a dot at the end for the reset of the name. All of the following examples would inlcude the class com.sap.portals.runtime.profiler.Monitor and its method doTest.
ProfilePackages | = | . | select all packages |
ProfilePackages | = | com.sap. | select all packages starting with "com.sap." |
ProfilePackages | = | .profiler. | select all packages containing pattern "profiler" |
ProfilePackages | = | .Monitor | select all classes with this name from all packages |
ProfileMethods | = | .doTest | select all methods with this name from all classes |
The TraceMethods and the ProfileMethods entries have additional features. You can specify the context of the method to profile. The context starts with a slash and knows the wildcards 1dot and 3dot. The context represents a call hierarchy of packages. If you whish for example to profile the method "lookup" only if it was called by a class of the package "com.sappportals.prt", you can specify
ProfileMethods | = | /.../com.sapportals.prt./.../.lookup |
In TraceMethods you can specify a comma seperated list of call parameters for the tracer in curly brackets. Its possible to call methods of objects as long as they don't need any call parameters. The method "toString" is used for the last object in the queue to generate something printable for output. If the brackets are empty, the tracer returns the list of call parameters.
TraceMethods | = | .Dispatcher.servcice { request.getRequestURI } |