After you have enabled your own application for profiling by calling the Interceptor.Initialize method, you can start your application and it will start collecting profiling information into messages immediately. To analyze and filter incoming data, you need to record it into a snapshot.
To collect the profiling information into a snapshot, you start a profiling session. You do that with either the visual gui (OrmProfiler.exe) or the command line tool (CliOrmProfiler.exe). You can also create snapshots from within code, which is described briefly later in this document.
To record data into a snapshot, start OrmProfiler.exe and on the Home tab, click the Record to snapshot button in the top left corner. Once you've done that, it will show you a dialog that it is profiling. You can pause profiling using that dialog, e.g. when you are performing activity in your application which is of no interest for the profiling session.
After you've started a profiling session with the Start Profiling button, go back to your application and start the activity which you want to analyze. This can be a single action or a lot of actions, depending on your application and what you'd like to profile.
Once you're done, go to the profiler UI again and click the Done button. The UI will now filter and analyze the collected data and open the snapshot in the UI in a separate tab. You can now save the snapshot to a file, export a view in a given format and re-analyze the snapshot if you want to analyze for different alerts.
Another way to record profile data into a snapshot is by using the Real Time View tab. Start OrmProfiler.exe and by default the client will open the Real Time View tab automatically. If you have closed this tab, you can open it again by going to the Home tab and by clicking the Open real-time view button.
As soon as the client receives profiling data it is displayed in the Real Time View tab. By default, the Real Time View offers an interval of time (defined using the auto-clean up feature controlled at the top left corner). It will record the last x seconds of data if Auto Data Clean up has been enabled. If you don't want to use auto-clean up, switch it off using the checkbox in the top left corner.
To record the data to a snapshot simply click the Record to snapshot button on the Real Time Viewer. You can pause recording by clicking Pause. To stop recording, click Stop recording. If data has been received, a snapshot is created using the filters and analysis settings defined in the client.
You can also create a snapshot in the Real Time View by selecting an area in the Activity Graphs sub tab of the Real Time View tab and then by clicking the Copy as snapshot button on the Activity Graphs subtab.
A snapshot records a lot of information when your application is running. It's therefore key to keep the running period of a profiling session to a minimum to keep snapshots small.
A different way to start a profiling session is by using the command line tool, CliOrmProfiler.exe. It has two modes, interactive and non-interactive. The interactive mode, invoked when specifying the argument /i, waits for the command stop typed on the command line. The non-interactive mode, which is the default, immediately returns after it has spawned a WCF service process in the background (using CliOrmProfilerService.exe) which performs the recording of the messages.
To stop the non-interactive service, start CliOrmProfiler.exe again with the /s argument.
The CliOrmProfiler.exe can perform filtering but doesn't apply any analysis. After it has saved the snapshot it created with the profiling data it recorded from the profiled application, you can load the snapshot file into the GUI application OrmProfiler.exe and click the Re-analyze button to perform analysis on the snapshot.
Help will be displayed if the CliOrmProfiler.exe is called with no parameters or with wrong ones. The CliOrmProfiler can be called with one or more of the following parameters:
CliOrmProfiler /i /d:DestinationFolder /f:FilteringSettingsFile /t:timePeriod /g:sampleSettingsFile
- If the destination folder is not specified, the snapshot file will be saved to the current directory.
- If the filtering settings file is not specified, default settings will be used (no filters enabled)
- Specify a time period for profiling to stop automatically. Time period is entered in the following format /t:xn. Where n is the quantity and x is either s for seconds, m for minutes, h for hours or d for days. Examples: /t:h3 = 3 hours.
Use the /g: parameter to specify a path in which a sample filtering settings file "sample.xml" will be generated.
Elements with an 's' at the end accept an array of values, and hence sub elements should be provided. Sub-element tags have the same name as the parent tag after stripping "FilterOn" and "Arguments".
<FilterOnDbTypeArguments> <DbType>Oracle</DbType> <DbType>SQLServer</DbType> </FilterOnDbTypeArguments>
- If /i is specified, the profiler will run interactively. This enables you to enter "stop" (without the quotes) to stop profiling at any time.
- If /i is not specified, a background service will be used for profiling and the CliOrmProfiler.exe will exit immediatly, leaving the job to the background service. In this case if you want to stop profiling manually, you will need to run CliOrmProfiler.exe again specifying /s It will stop profiling and terminate the background process before exiting. It's worth mentioning that the CliOrmProfiler.exe communicates with the background process throught TCP port 7777, which is configurable from both the CliOrmProfiler.exe.config & CliOrmProfilerService.exe.config files.
Which files to copy to a remote system to perform a profile action on the command line on that system?
The folllowing files should be copied to the remote system so you can perform a profile action using the CliOrmProfiler.exe. The CliOrmProfilerService.exe and related config file are optional, and only needed if you use the CliOrmProfiler.exe in the non-interactive mode.
- CliOrmProfilerService.exe (optional, see above)
- CliOrmProfilerService.exe.config (optional, see above)