< Previous section Content Next section >
Depending on the solving problem, you can run LightProfiler with the graphical interface or with the command line interface.
To help you decide, consider the following facts:
The command line interface is preferred to generate the profile for large trace-files. In other cases, the graphical interface will be the best choice.
To run application with command line interface you should execute the starter file: (lightprofiler.py or lightprofiler.exe), using parameters. This parameters may be grouped as shown:
All required parameters must be listed after the name of the executable file (lightprofiler.py or lightprofiler.exe), and missing optional parameters will be replaced with values from the configuration file, or with default values (additional information about optional parameters - application options, you can read in the relevant section Options).
The following parameters are required to run the application with command-line interface:
The special parameters are:
Here is a sample of launch application from command line:
Pic. 5 Launch application without graphical interface
The application starts with graphical interface by default. To launch, you should to perform following steps, depending on the application's format:
Appearance
When you run the application with GUI, you are automatically taken to the main window:
Pic. 6 Main window
On the main window can be highlighted following areas:
Shown early picture also contain sample of the profiler window (area 5), more detailed description you can found in relevant section Profiler.
Menu
The menu for current version of LightProfiler has the following structure:
Pic. 7 Official site
Pic. 8 Donating page
Pic. 9 Page of the comment
Pic. 10 Page of the bug report
Note:
Toolbar
The application toolbar has the following control elements:
Profiler
Profiler — built-in application's tool, designed to analyze trace-files and generate reports. When you run a GUI application you can use any number of profilers.
Below is an example of profiler window:
Pic. 11 Profiler window
For profiler window can be highlighted following areas:
Pic. 12 Windows for profiler and profile's section
General
This tab contains control elements for trace-file selection and writing comment9.
Pic. 13 Tab “Common”
Log
This tab is used to display log of the active profiler. The contents of a tab can be cleared (click button “Clear“) or uploaded to a file (click button “Upload“).
Pic. 14 Tab “Log”
Also, the log has built-in search tool, which you can call by pressing Ctrl + F.
Pic.15 Search dialog
Search result(s), are highlighted in the log (this selection will be reset when re-search, or after pressing the button “Reset All”).
Note:
Debug
Note:
Using the application in debug mode allows you to collect additional information for SQL statements: source lines of the trace-files, the details of the performed calculations as well as generate sdmp-files (see Glossary)
Pic.16 Tab “Debug”
On this tab can be highlighted the following groups of elements:
The current version of application allows you to debug with the following modes:
Note:
Tools
This section describes the basic tools as well as the necessary information about their development.
LpCombiner
LpCombiner – this tool was designed for extracting session data from one or more trace-files.
Pic. 17 Tool “LpCombiner”
Depending on configuration of the Oracle server and used OS, in the trace-file data can be placed several sessions or data of one session can be placed in several trace-files. To solve these problems and designed this instrument. It parses contents of the trace-files in search of session IDs (strings like *** SESSION ID :...) and arranges them in the correct order (according to date), forming a new “pseudo“ trace-file.
There is toolbar in the upper part of the “Control” tab, that allows you:
In the lower part you can see list of trace-files selected for analyze.
LpSplitter
LpSplitter – this tool was designed for splitting trace-file on some parts.
Pic. 18 Tool “LpSplitter”
To perform splitting of the trace-file you need:
If necessary, you can include trace-file's preamble to the generated trace-files, by checking the field “Add preamble in file”.
LpDBMonitor
LpDBMonitor – a light-weight Oracle database monitor. Show database sessions and related information. Also it allow start/stop tracing or disconnect session.
Note:
Pic. 19 Tool “LpDBMonitor”
The tool's window can be divided on following areas:
Development
Tool – this is application, written in Python language, has an interface that uses tkinter library, and formed according to specific requirements.
The files, used for tool, are placed in the separate folder (hereinafter – tool's folder), which has a specified structure. Below is the structure for the tool LpSplitter:
Consider process of developing your own tool called usertool on OS Windows:
##########################
### global translator
##########################
go_translator = cl_ToolTranslator()
_ = go_translator.get
_u = go_translator.get
, where cl_ToolTranslator — a object that imported from module lptoolapi
def __init__(self,**kw):
global go_translator
kw['helptext'] = __toolhelp__
kw['translator'] = go_translator
kw['toolpath'] = os.path.split(__file__)[0]
kw['toolid'] = __toolid__
kw['toolname'] = __toolname__
kw['toolversion'] = __toolversion__
if 'mw' not in kw:
kw['mw'] = __toolmw__
if 'mh' not in kw:
kw['mh'] = __toolmh__
cl_ToolAPI.__init__(self,**kw)
self.__guiitem = cl_ToolAPI.api_get_guiitem(self)
On this step – process of creating the tool is completed – a new tool is available for use in the LightProfiler:
Pic. 20 Addition of new tool
Commands
“Commands” - a mechanism that allows to execute commands in the OS or run other applications from LightProfiler, if necessary, using the attributes of the active profiler.
Settings
Setting up commands is done in the dialog “Commands”, that can be accessed via the application menu (Environment/ Commands), or from the toolbar (button “Commands”).
Pic. 21 Dialog “Commands”
The dialog consists of the following areas:
Creating or editing commands are done in the “Command editor” - dialog, designed for entering text and command's parameters.
Pic. 22 Dialog “Command editor”
Parameters
When editing the command, you can use special tags "Parameters" - snippets of text that will be replaced with specific values when you run the command.
In the current version of application you can use the following parameters:
Execution
You can execute configured commands as follows:
1The application will create missed profilers if a user will select few trace-files
2“Parse” operation must be executed before generating of any report
3Was listed only basic tools of the current application version
4This dialog also can be called with key combination Ctrl-O
5You need pdf-viewer for opening such file
6By default, application supplied with English version of the manual, if necessary, you can download manual on other languages and place it in the “doc” folder
7Dialog for tuning options may be called by pressing Ctrl+P
8The profiler has less available options then the entire application
9If the “Comment” field was filled, its contents will be included as an additional section of the report “Resource profile”
10The application uses an identifier that builded according rule: 0_RPC_<unique serial number for subprogram in trace-file> for RPC CALL statement
11Size of the generating trace-files may differ from the specified value, because occurring line-by-line copying during split, and not calculated size of the trace-file's preamble.
12Passwords NOT saving by security reasons
13You can use key combination Ctrl-L for jump to selected session from this tabs
14Tool's folders are placed in <Application folder>/resources
15The tool icon can be added in the text format, detailed description can be found in recipe: http://code.activestate.com/recipes/52264