|
| This chapter describes
the general usage of TG. It assumes that you have already installed
TG in the "C:\tg09X" directory. |
| To begin with, startup TGC that is the management tool of TG. Double-click "tgc.exe" or Enter at the command line as follows. |
| |
* COMMAND-LINE SAMPLE
|
C:\> cd tg09X
C:\tg09X> tgc
|
|
| |
| The window of TGC is displayed, and the start message of TG is displayed on the "TG Console screen" . Look at the sample below. |
| |
TG - Transaction Generator - [ Version 0.9X ] Sat Jun 16 01:05:59 JST 2007
Checking specified address & Port is possible to use... .OK.
Operating mode : "SERVER_FOR_TGC".
  - Listening Address : 0.0.0.0
  - Port : 11111
TG - Transaction Generator - [ Version 0.9X ] Sat Jun 16 01:06:00 JST 2007
logged in.
TG> |
|
| |
  |
|
Step2 |
- Load the sample configuration - |
                                  |
Load the sample configration file. Click "File" and select "Open". Next, choose "C:\tg09X\sample.tgp" file. |
When the configration file has been loaded successfully, the following message will be displayed in the "TG Console". The configrations of TG and TGC are syncronized automatically. |
| |
TG> Syncronization has completed succesfully.
TG> reload config
Loading configration file... .OK.
Registered transactions:4 , variables:5 , jobs:1 , slave servers:0
TG> |
|
| |
  |
|
Step3 |
- Edit and confirm the configuration - |
                                  |
Click "Agent" and select "Configure Agents...". You can confirm and edit a configration here. |
The content of the "Database" tab is as follows. In this tab, you can defaine target database information. For example, JDBC driver and JDBC driver type, hostname, port number, SID name...
|
The content of the "Agents" tab is as follows. In this tab, you can define username and password, the number of sessions, Thinktime, etc.. Agents connect to the database using these parameters. |
The content of the "Variables" tab is as follows. On the left side of the window, the list of variable names registered in TGC is displayed. When you click the name, the propaties of specified variable are displayed on the right side. You can define the type (Variable type) and the range (Minimum value, Maximum value, values) of the specified variable. |
The content of the "Transactions" tab is as follows. On the left side of the window, the list of transaction names registered in TGC is displayed. When you click the name, the propaties of specified transaction are displayed. You can define the execution ratio (Average of execution) and SQL statements (SQL Statement) of the specified transaction. |
Incidentally, in this sample (sample.tgp), it is necessary to make the following objects for the schema of the target database. |
| |
|
|
Table |
create table test (
id number,
ndata number,
ddata date,
cdata varchar2(255));
|
Sequence |
create sequence idseq start with 1 increment by 1
nomaxvalue nominvalue nocycle nocache;
|
Index |
alter table test add constraint pk_test_id primary key (id); |
|
| |
The content of the "Jobs" tab is as follows. On the left side of the window, the list of job names registered in TGC is displayed. When you click the name, the propaties of specified job are displayed. You can define the type (Job type) and the script which is executed as a job (Command path or Script text).
Finally, click "OK" and close "Configure TG" window. |
When you close the window, automatically the configrations of TG and TGC will be syncronized. |
| |
TG> Syncronization has completed succesfully.
TG> reload config
Loading configration file... .OK.
Registered transactions:4 , variables:5 , jobs:1 , slave servers:0
TG> |
|
| |
  |
|
Step4 |
- Check the current configuration - |
                                  |
Click "Agent" and select "Check Configration". You can test if agents can connect to the target database using a current configration.
|
When agents connect to the database successfully, JDBC URL and JDBC driver information will be displayed as follows.
|
  |
|
Step5 |
- Start transactions - |
                                  |
Click "Agent" and select "Make agnets connect to the target database". Now you can make agents connect to the target database.
|
See "TG Status" sub window on the left side of the main window of TGC. "Target agent status" value changes from "TERMINATED" to "WAITING", and "CONNECTED" value begins to increase. "CONNECTED" value stop at "10", because the parameter of "Sessions" is set to "10" at this point in time.
|
Next, Click "Agent" and select "Activate agents". You can begin to send queries ( agents call SQL statements ) on the database server.
|
"Target agent Status" value changes from "WAITING" to "ACTIVE", and "TPS" value begins to change. The value of "TPS" shows the number of execution of the transaction for one second.
|
The transaction statistics can be confirmed by "TPS Monitor" tab. The measurements are displayed as graphs(*).
(*) This function is supported from TG version 0.90. |
Next, Click "Monitor" and uncheck "Enable graph". You can also confirm text based transaction statistics once a second.
|
| |
16:21:25 TRGT:WAIT CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:0
16:21:26 TRGT:WAIT CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:0
16:21:27 TRGT:WAIT CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:0
16:21:28 TRGT:ACTV CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:4
16:21:29 TRGT:ACTV CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:42
16:21:30 TRGT:ACTV CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:48
16:21:31 TRGT:ACTV CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:50
16:21:32 TRGT:ACTV CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:49
16:21:33 TRGT:ACTV CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:48
16:21:34 TRGT:ACTV CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:49
16:21:35 TRGT:ACTV CONN:10/10 DISC:0/10 TERM:0/10 ERR:0 TPS:49 |
|
| |
If you want to stop the transaction, Click "Agent" and select "Freeze agents". Under this condition, Agents stop activity but the session between agents and target database remains. If you restart transactions, select "Activate agents" again.
|
If you want to stop transactions and disconnect agents from the database, Click "Agent" and select "Make agents disconnect from the target database".
|
"Target agent status" value change from "WAITING" to "TERMINATED", and "CONNECTED" value begins to decrease and "TERMINATED" value increases. This shows that Agent is disconnected from the target database and deactivated.
|
  |
|
Step6 |
- Terminate TG/TGC - |
                                  |
Click "File" and select "Exit" at TGC main window.
|
At the center part of TGC, "Terminate TG Controller" window is displayed. Click "YES" and terminate TGC and TG. |
|