The controller input files include the configuration, script, and distribution files and the optional performance counters file. (For information about creating and using the optional performance counters file, see “Writing a WCAT Performance Counter Input File,” earlier in this guide.)
To create a custom test, you can either edit one of the prepared tests or create new controller input files. The changes you make to the input files can change test conditions, the content pages that clients request, and the frequency at which pages are requested. The general procedure is as follows:
1.Edit a sample configuration file, or write a new configuration file, to change the variables that define the number of client computers, the number of threads per client, the duration of the test, or any combination of these conditions. (Keep in mind you can override any of these variables at test time by using run command-line options.)
2.Edit a prepared test script file, or write a new script file, to identify a new set of content pages for virtual clients to request from the server.
3.Edit a prepared test distribution file, or write a new file, to specify the frequency at which clients request the pages identified in the script file.
You can use any word processor or text editor to edit the controller input files.
The configuration file is located on the controller. After the Wcctl.exe program is started, it reads the configuration file to determine how many clients are included in the test and what test instructions to send to the clients. The client instructions that you can change in the configuration file are described in the following table.
Table 9 Test Parameters in the Configuration File
Parameter name | Description | Action you can perform |
Thinktime | Value that determines the time interval between client requests sent to the server. | Increase or decrease this value to change this time interval. |
MaxRevBuffer | Size of the client buffer. The default value is 64K. The controller sends this information to the client computers. | Increase this value to increase the size of the client buffer. This value can be increased to a maximum number of 128K. (WCAT sets no limit. However, a large MaxRevBuffer value means more memory is consumed on the client; a small value means that the client might be slow.) Increasing the client buffer size is recommended when testing a server program that contains large amounts of data. |
CooldownTime | End of test time interval, which is excluded from test results to eliminate the effects of processing completion from the test results. The controller sends this information to the client computers. | Increase or decrease this value to change the amount of time the client can use to complete all processing and data collection. Changing this variable increases or decreases the total test time. |
WarmupTime | Start of test time interval, which is excluded from test results to minimize the effect of time spent starting the clients and server on test results. The controller sends this information to the client computers. | Increase or decrease this value to change the amount of time allowed for client and server startup. Changing this variable increases or decreases the total test time. |
Table 9 Test Parameters in the Configuration File (Continued)
Parameter name | Description | Action you can perform |
NumClientMachines | Number of client computers used in the test. The default value is 1. | Increase or decrease this number to change the number of clients the controller accepts as participants in the test. |
NumClientThreads | Number of virtual client sessions run on a single client computer. The default value is 1. The controller sends this information to the client computers. | Increase or decrease this value to include multiple virtual clients. The maximum value is 100. The recommended value is as many clients as you can run on the client computer before it becomes CPU saturated; experiment and find the optimal value for your system. |
Duration | Time value that describes how long the test should run, in seconds. The controller sends this information to the client computers. | Increase or decrease this value to change the test time period. Note that the cooldown time and warmup time are not included in this value. Thus, total test time equals the column values CooldownTime + Duration + WarmupTime. |
Each prepared test uses a script file that defines the client and server transactions performed during the experimental period. After the controller is started and connected to the test clients, the controller program reads the script file and sends instructions to each client. These instructions describe the content requests the clients are to send to the server during the experimental period.
Following is a sample script file.
# ###################################################################### # # Test script file for WCAT # # ###################################################################### # Format of Script Specification: # # ClassId Operation Files # Note: Operation Strings are case insensitive # # Reserved Ids # Class Ids 1-10 are reserved for fixed file size classes # Class Ids 101-110 are reserved for CGI scripts # Class Ids 201-210 are reserved for ISAPI scripts # Class Ids 301-310 are reserved for Post Operation # Class Id 0 is reserved for special purposes # # Class Id Range Recommended Usage # 1-100 File transfers # 101-200 CGI Requests # 201-300 ISAPI Requests # 301-400 Post Requests # # Plaza Welcome page => NEW TRANSACTION classId = 1 NEW REQUEST HTTP Verb = “GET” URL = “/scripts/welcome.py” # Click Repeat Shopper => Plaza Lobby NEW TRANSACTION classId = 2 NEW REQUEST HTTP Verb = “GET” URL = “/prd.i/pgen/plaza/JQ04Q9JF66SH2JS700Q79TREBNBGAU1M/plaza1.html” # Click AG => AG Lobby NEW TRANSACTION classId = 3 NEW REQUEST HTTP Verb = “GET” URL = “/prd.i/pgen/ag/JQ04Q9JF66SH2JS700Q79TREBNBGAU1M/lobby.html” # Click Big Picture NEW TRANSACTION classId = 4 NEW REQUEST HTTP Verb = “GET” URL = “/prd.i/pgen/ag/JQ04Q9JF66SH2JS700Q79TREBNBGAU1M/ag_bigpicture.html”Note that the script file begins with comments that recommend a class numbering system for different types of client-server transactions. Following the comment lines are sample transactions. When you create your own script file, use the recommended class identification numbering to identify your transactions. The class identifiers are used to group together similar transactions in the class statistics section of the controller log file. For more information on this log file section, see “Class Statistics Section,” earlier in this guide.
There are four types of program statements you can use in a script file to define new transactions. These are:
· Global commands
· Transaction commands
· HTTP request commands
· ClearCookie request commands
These commands are described in the following sections.
The following global commands can be used anywhere in the script file.
set <default_variable> = <value> <default_variable> := ClassId | Server | Verb | URL | Cookie | Port | ResponseStatusCode |KeepAlive | Authentication <value> = <BOOLValue> | <DWORDValue> | <StringValue> | <WORDValue> <BOOLValue> = TRUE | FALSE <DWORDValue> = decimal number < 4,294,967,296 <FileOrStringValue> = <FileValue> | <StringValue> <FileValue> = FILE <StringValue> <StringValue> = quoted string. \r, \n, \t, and \\ are special escape sequences for carriage return, line feed, tab, and '\'. <WORDValue> = decimal number < 65,536 ClassId, ResponseStatusCode, and Authentication are DWORDValues. Server, Verb, URL, and Cookie are StringValues. Port is a WORDValue. KeepAlive is a BOOLValue. NEW TRANSACTIONThese following commands are used to define a client-server transaction. The commands must be preceded by a NEW TRANSACTION statement, which signifies a new transaction. You must use the NEW TRANSACTION statement for each transaction you define.
Table 10 Transaction Commands
Command | Description |
ClassId = DWORDValue | Required. ClassId is the class identifier for the transaction. It is used in the distribution file to specify the distribution (that is, the pattern and frequency of requests) for this transaction. The recommended value ranges for a ClassId are 1 through100 for file transfer transactions, 101 through 201 for CGI transactions, 201 through 300 for ISAPI transactions, and 301 through 400 for post transactions, a type of HTTP request. |
Server = StringValue | Server is either the NetBIOS name, DNS host name, or IP address of the server included in the transaction. Note that you can run a WCAT test with multiple servers. |
NEW REQUEST HTTP | This command starts a new HTTP request. For more information on HTTP requests, see the next section. |
NEW REQUEST CLEAR_COOKIE | This command starts a new CLEAR_COOKIE request. For more information on ClearCookie requests, see the “ClearCookie Request Commands” section, following. |
The following commands are used to define a HTTP request. These commands must be preceded by a NEW REQUEST HTTP statement, and you must use the NEW REQUEST HTTP statement for each HTTP request you define in the script file.
Table 11 HTTP Request Commands
Command | Description |
Cookie = StringValue | Specifies the cookie name to use. Any cookie sent back to the client as a result of this request is stored in this name. This request includes the cookie to be stored in this name. |
Verb = StringValue | Specifies the verb to use for this request. Common verbs are GET, POST, and HEAD. |
URL = StringValue | Specifies the URL to use for this request, for example /perfsize/file1k.txt |
KeepAlive = BOOLValue | Specifies the client should use the “Connection: keep-alive” protocol.Doing so keeps the TCP/IP connection open between the client and the server between requests. This option should not be used in conjunction with the SSL protocol. |
SSL = BOOLValue | Specifies the client should use the SSL encryption protocol for this request. |
ResponseStatusCode = DWORDValue | Specifies the expected response code for this request. For most requests, this code is 200. |
Port = WORDValue | Specifies the port for the TCP/IP connection for this request. For most requests, the port is 80. |
UserName = StringValue | Specifies the user name for basic authentication. |
Password = StringValue | Specifies the password for basic authentication. |
RequestHeader = StringValue | Request headers are cumulative over a request. In other words, if you have multiple RequestHeader statements in the same HTTP request, they are all sent. |
ResponseHeader = StringValue | Response headers are cumulative over a request. In other words, if you have multiple ResponseHeader statements in the same HTTP request, WCAT looks for all these headers in the response. If you have multiple response headers in the same ResponseHeader statement, they must be returned in the given order to pass the response comparison test. |
Table 11 HTTP Request Commands (Continued)
Command | Description |
Authentication = <DWORDValue> | For Authentication, 0 means anonymous and is the default; 1 means basic authentication. |
SaveResponseFile = StringValue | The server’s response to the current request is saved on the client under the filename given. This command is provided to make creating a ResponseData file easier. For more information on ResponseData, see the following. |
ResponseData = FileOrStringValue | Specifies the data the server should return in response to the current request. This data can be specified either as a quoted string or as a filename. If the latter, the file is read and transmitted to the client for comparison. Use a file if the data is large or contains nonprinting characters. |
RequestData = FileOrStringValue | Specifies data to send to the server with this request. This option is generally used for POST requests. |
A ClearCookie request command deletes a cookie name. The old name for the cookie is wiped out. This command must be preceded by a NEW REQUEST CLEAR_COOKIE statement, and you must use the NEW REQUEST CLEAR_COOKIE statement for each ClearCookie request you define.
Command syntax is as follows
Cookie = StringValue
where StringValue is the cookie name to be deleted.
Each modified or new script requires a modified or new distribution file. The distribution file is used by the controller and the client computers to assign a percentage of total test time to each transaction. The controller also uses this file to calculate test results and write them to the log file.
The distribution file lists each of the transactions in the script file by using the class identifier assigned to the transaction. Each listed transaction is assigned a distribution value. The distribution value identifies the portion (percentage) of the experimental period during which each transaction is performed.
A sample distribution file is illustrated following.
# ###################################################################### # # Test WCAT Distribution File # # This file specifies the distributions that # can be applied to the script file # ###################################################################### # # Format of Script Specification: # # ClassId Distribution Factor(0 to 100) # # Sum of all distribution factors should be strictly 100 and # each factor can have only a single digit after the decimal point. # #First column is class number. Second value is percentage of test time. 1 10.5 29.5 310 470To create a custom distribution file, you must list each transaction using the class identifier and provide a corresponding distribution value.