Anda di halaman 1dari 62

Load Generator Tool Documentation

Microsoft Corporation November 2005

Table of Contents
Introduction..............................................................................................................................4 Load Generator Overview........................................................................................................5 LoadGen Architecture..........................................................................................................7 Presentation Tier..............................................................................................................7 Framework Tier................................................................................................................7 Component Tier...............................................................................................................8 Installing Load Generator....................................................................................................9 LoadGen Folders............................................................................................................10 LoadGen Binaries...........................................................................................................10 Using Load Generator........................................................................................................11 Dynamic Message Creation...............................................................................................12 Load Generator Reference.....................................................................................................15 Configuration File Reference.............................................................................................16 <Assembly>...................................................................................................................18 <CommonSection>........................................................................................................19 <DstFilePath>................................................................................................................21 <DstLocation>................................................................................................................22 <LoadGenFramework>..................................................................................................23 <LotSizePerInterval>.....................................................................................................25 <MessageCreator>.........................................................................................................26 <Monitor>......................................................................................................................28 <NumFiles>....................................................................................................................30 <NumThreadsPerSection>.............................................................................................31 <OptimizeLimitFileSize>..............................................................................................32 <Parameters>..................................................................................................................33 <QueueLength>..............................................................................................................35 <RetryInterval>..............................................................................................................36 <Section>.......................................................................................................................37 <SleepInterval>..............................................................................................................39 <SrcFilePath>.................................................................................................................40 <StopMode>...................................................................................................................41

<TemplateFilePath>.......................................................................................................43 <ThresholdRange>.........................................................................................................44 <ThrottleCondition>......................................................................................................46 <ThrottleController>......................................................................................................48 <TotalTime>..................................................................................................................50 <Transport>....................................................................................................................51 <ContentMaxSize>........................................................................................................53 <ContentMinSize> ........................................................................................................54 <DataType>....................................................................................................................55 <Field>...........................................................................................................................56 <InitialValue>................................................................................................................57 <InputFilePath>..............................................................................................................58 <MessageCreator>.........................................................................................................59 Load Generator Samples........................................................................................................60 Configuration File Samples...............................................................................................61 Template File Sample........................................................................................................62

Introduction
This document provides an overview of the Load Generator tool (LoadGen) and reference pages detailing its use. Microsoft Corporation provides LoadGen to assist Microsoft BizTalk Server users and extenders in testing their BizTalk Server configurations and enhancements.

Load Generator Overview


The Load Generator tool, typically referred to as LoadGen, provides a simple, generic, reliable, and consistent tool for generating the workload data required to test BizTalk Server. LoadGen offers the following important features and benefits: Ease of use. LoadGen enables BizTalk Server users to generate messages that simulate incoming data to their BizTalk Server installations. This enables them to test how their servers handle both normal and extreme workload conditions. Straightforward configuration. By using a well-defined set of XML tags in a configuration file, LoadGen users can create a wide range of highly customized test cases. Manual or automatic execution. All test cases can be run from the command line. Therefore, you can execute them manually or as part of a batch file for automated testing. Flexible data generation. LoadGen supports optional dynamic data manipulation, dynamic throttling, and resource monitoring. It also supports a variety of transport methods and protocols. Auto-throttling and custom throttling support. LoadGen is capable of heuristically throttling the flow of test data based on runtime information. It can also ensure that a fixed rate of data flow is maintained by adjusting the flow upward or downward. Supports custom throttling; for example, based on server backlog files in folder, rows in tables, or message instances in queues. Granular control of data flow. Supports different amounts of load generation for each resource destination. Multiple run duration modes. You can configure LoadGen to run tests for a fixed period of time or make it send a fixed number of files per run. The end conditions for each run are up to you. Ability to transmit large files. To enable testing of high-end server configurations, LoadGen can generate extremely large files that contain gigabytes (GB) of test data. It can then stream the test data to the servers being tested. Centralized control. You can run LoadGen remotely and generate workload data for one or more servers over your network. This ability enables you to exactly control the kind and volume of load data that your servers receive. From one test computer, you can simulate everything from peak to low usage conditions for all of your servers. Stability and efficiency. Microsoft has tested and optimized LoadGen for BizTalk Server testing. In fact, Microsoft uses LoadGen for its own tests. Reliability. LoadGen robustly handles multiple threads that stress multiple servers for long periods of time. Its performance does not degrade over time.

Scalability. LoadGen can generate load data by starting multiple threads for each resource. In addition, it can concurrently generate test data for multiple servers. Fault tolerance. In the event of network outages or resource errors, LoadGen can recover and continue without having to restart the test from the beginning. Low resource demand. You can run LoadGen on average client computers using minimal CPU time and memory. Modular architecture. Although LoadGen is designed for use with BizTalk Server, its modular architecture enables you to use it for a variety of network simulation purposes. Extensibility. The modular design of LoadGen enables you to extend its functionality through custom load generators, message creators, and resource monitors. Dynamic data generation. Through the use of configurable message creators, LoadGen enables you to create customized messages that can be sent to computers running BizTalk Server. LoadGen Architecture Installing Load Generator Using Load Generator Dynamic Message Creation

The remainder of this section explains these features and benefits in the following topics:

LoadGen Architecture
To use LoadGen, it is necessary to understand its modular architecture. LoadGen is built in three tiers, as shown in the following figure. Architecture of the LoadGen Program

Each of the three tiers shown in the preceding figure interacts with the others in standardized ways. The individual modules in each tier are completely independent of each other. This architecture enables you to add custom replacements or enhancements for modules in the component tier.

Presentation Tier
The presentation tier contains the user interface for the LoadGen program. Currently, LoadGen supports a command-line interface. This enables both manual load testing and automated testing by running the LoadGenConsole application from a command (.cmd) or batch (.bat) file. The primary tasks of the presentation tier are to invoke the framework in the framework tier, read the XML configuration file, and pass the contents of the configuration file to the framework.

Framework Tier
The framework tier includes the "brains" of the LoadGen application and contains its primary application framework. The framework receives the information from the XML 7

configuration file that the presentation tier passes to it and uses that information to instantiate the load generators, message creators, and throttle controllers needed for the test. The LoadGen framework uses message creators to dynamically generate message data. The messages are then forwarded to the load generator, which transmits them by using the transport methods specified in the XML configuration file. If desired, you can have the framework use throttle controllers to monitor the delivery of messages and dynamically adjust the message flow based on parameters in the XML configuration file.

Component Tier
The component tier contains load generators, message creators, and throttle controllers. The LoadGen framework instantiates these three types of components as specified in the XML configuration file. Message creators are optional components that you can use to dynamically generate random data. Messages can be created in one of two modeseither synchronously or asynchronously. When you use synchronous message creation mode, each message is unique because the process of message generation is serialized on a single thread of execution. This mode enables you to simulate data that has, for example, unique transaction numbers. To guarantee that each message is unique, you should only specify one message creator in the XML configuration file when you select synchronous message creation mode. You can, however, use multiple load generators. Because message generation is serialized on a single thread of execution, LoadGen cannot guarantee a specific rate of message creation in synchronous message creation mode. In asynchronous mode, the message creator can randomly modify data for each message. Asynchronous mode causes the message creator to use multiple threads of execution. As a result, it is possible that not every message is unique. Because asynchronous mode uses multiple threads, LoadGen can provide messages at a rate that you specify. As with all components in the component tier, message creators are completely modularized. You can write your own message creators to replace or augment the message creators that come with LoadGen. The LoadGen application comes with a sample message creator in the SizeMC folder, which is created when you install LoadGen. It also ships with two default message creators. One generates messages of varying sizes. The other creates messages based on parameters you specify in an XML template file. Using template files with the custom message creator is typically sufficient for the vast majority of LoadGen users. Typical users do not need to write their own message creators. The framework takes messages that it receives from message creators and passes them along to load generator components. Load generators perform the task of sending messages by using a specific transport. Each type of transport requires its own load generator. You can use multiple load generators at the same time by specifying the ones you want to use in the XML configuration file. LoadGen ships with the load generators that are specified in the following table. Load Generators Supplied with LoadGen 8

Name
File Transport HTTP Transport SOAP Transport

Description
Saves the message data as files in the destination folder specified in the XML configuration file. Supports both asynchronous and request-response messaging. Supports both asynchronous and request-response messaging. Requires both headers and envelopes as parameters. Message Queuing. Private data can be transactional or non-transactional. Supports large messages. (Messages containing more than 4 megabytes (MB) are considered large.) IBM WebSphere Message Queue Series. Message can be local or remote, in-order or unordered, persistent or non-persistent. Web Services Enhancements. Supports both asynchronous and request-response messaging. Windows SharePoint Services.

MSMQ Transport

MQ-Series Transport

WSE Transport WSS Transport

You can create load generators that use additional transports by using the FileTransport sample that the LoadGen install program creates on your installation drive. Throttle controllers are also called resource monitors. They are components that monitor the data flow to ensure that the selected load generator is producing message data at a rate that conforms to the parameters specified in the XML configuration file. If the throttle controller indicates that data is being produced too slowly, LoadGen throttles data production upward to increase the flow. If the throttle controller indicates that data is being produced too rapidly, LoadGen throttles the data flow downward. Throttling is performed by the LoadGen framework, rather than by the throttle controllers. A throttle controller simply indicates whether the flow is too fast, too slow, or within acceptable limits. Because throttle controllers are in the LoadGen component tier, they are completely replaceable. You can create your own throttle controllers by using the sample in the FileMonitor sample that the LoadGen install program creates on your hard disk.

Installing Load Generator


To install Load Generator, use the following procedure. 1. Run the executable program you downloaded. This launches the LoadGen Setup Wizard. 2. Click Next. 3. Read the end user license agreement (EULA), select I accept the License Agreement, and then click Next. 4. Select the account under which to install the tool.

5. In the dialog box that appears, either accept the default installation folder (C:\LoadGen), or specify a different folder. If you select a different folder, you can click Browse to locate or create the desired folder. Then, click Next. 6. To confirm the selected options, click Install. This installs the LoadGen tool in the specified folder. 7. Click Finish to end the installation.

LoadGen Folders
The installation creates the following folder structure.
LoadGen \ConfigFiles \ConsoleConfigFiles \Templates \Docs \Samples \FileMonitor \FileTransport \SizeMC \Bins Sample monitor (throttle controller) component source code Sample LoadGen load generator component source code Sample LoadGen message creator component source code All binary files XML configuration files required by LoadGenConsole.exe Sample message creator template files This document Root folder for LoadGen

LoadGen Binaries
The following binaries are installed in the LoadGen\Bins folder. Framework Name
LoadGen.dll LoadGenConsole.exe

Description
LoadGen framework Console application command-line shell

Load Generators Name


FileTransport.dll HTTPTransport.dll SOAPTransport.dll WSETransport.dll WSSTransport.dll MQSeriesTransport.dll MSMQTransport.dll

Description
Generates load test data for the FILE/UNC/FTP/POP3 transports Generates synchronous or asynchronous load test data for the HTTP transport Generates synchronous or asynchronous load test data for the SOAP transport Generates load for WSE Generates load for WSS Generates load for MQ-Series queues Generates load for MSMQ queues

10

MSMQTransmitter.dll Interop.MSMQTRANSMITTERLib.dll

Unmanaged COM component used by MSMQTransport.dll MSMQTransport.dll MSMQMonitor.dll dependency

Resource Monitors (Throttle Controllers) Name


FileMonitor.dll RateMonitor.dll SQLMonitor.dll MQSeriesMonitor.dll MSMQMonitor.dll PerfCounterMonitor.dll PerfCtrDiffMonitor.dll ComFileMonitor.dll Interop.ComFileMonitorLib.dll ComMsmqMonitor.dll Interop.ComMsmqMonitorLib.dll

Description
Monitors number of files in local and remote folders Computes rate at which load is generated Monitors row counts in Microsoft SQL Server database tables Monitors number of messages in MQ-Series queues Monitors number of messages in MSMQ queues Monitors performance counters Monitors difference between two performance counters Unmanaged COM component used by FileMonitor.dll FileMonitor.dll dependency Unmanaged COM component used by MsmqMonitor.dll MsmqMonitor.dll dependency

Message Creators Name


SizeMC.dll CustomMC.dll

Description
Dynamically explodes data file to required size Dynamically modifies fields in data file based on template settings

Dependencies Name
AmQmDNet.dll

Description
MQSeriesTransport.dll: MQS runtime requirement. This runtime file is to be downloaded from the IBM [MQ-Series] Web site. WSETransport.dll: WSE runtime requirement MSMQTransmitter.dll MSMQ runtime requirement WSSTransport.dll runtime requirement

Microsoft.Web.Services2.dll MqrtLarge.dll MS.Test.BizTalk.KwTpm.SharePointOM.dll

Using Load Generator


Before you can run LoadGen, you must create an XML configuration file that specifies the parameters of the test youre going to run. You can give the configuration file any name.

11

When you invoke the LoadGen program from the command line, you pass the name of the configuration file to LoadGen as shown in the following example.
LoadGenConsole filename.xml

In this example, LoadGen is invoked from the command line and passed an XML configuration file called filename.xml. As previously stated, you can give your configuration files any name you prefer. The XML tags in a LoadGen configuration files must reside within the <LoadGenFramework> and </LoadGenFramework> tags. The first pair of tags within <LoadGenFramework> and </LoadGenFramework> should be <CommonSection> and </CommonSection>. As the name implies, these tags define the common section of the configuration file. You use the common section for defining default values for load generators, message creators, and resource monitors (throttle controllers). For the components that do not use the default parameter values, you can provide parameters that override the default values. For example, suppose you want to use five load generators in your test. Imagine that three of the five load generators use a set of default values for their load generation parameters. Two of the five load generators use load generation parameter values that are different from the defaults. In this case, you would specify the default values used for all load generators in the common section. You would then specify the parameters for the other two load generators within XML blocks of their respective <Section> tags. Doing so overrides the values specified in the common section. The default parameters set in the common section include the stop mode, the number of threads per section, the lot size per interval, and the retry interval. For more information about these parameters, see Configuration File Reference in this document. In addition to default values for the components the test uses, the common section of the XML configuration file specifies the transport that the load generator uses. It also contains related information such as the name of the assembly that implements the transport. In addition, your configuration file uses the common section to specify the throttle controller to use, if you decide to use one. Most tests use throttle controllers. After the common section, LoadGen configuration files typically contain one or more pairs of <section> and </section> tags. LoadGen uses information in these tags as parameters to load generators. The information can supplement or override the load generator parameters specified in the common section. Therefore, the <section> and </section> tags can contain many of the same tags used in the common section. Additionally, the <section> and </section> tags normally hold the <DstLocation> and </DstLocation> tags. These tags in turn contain the <Parameters> and </Parameters> tags. The <Parameters> and </Parameters> tags hold a list of XML tags that are specific to the type of load generator being used. Each type of load generator has a specific set of tags that it recognizes.

Dynamic Message Creation


To enable you to more closely simulate the real-world conditions in which you use BizTalk Server, LoadGen can dynamically create messages in which some of the data varies from

12

message to message. For example, you can have LoadGen create messages that have a random integer transaction number. The first step in adding dynamic message creation to your tests is to add the <MessageCreator> tag to your LoadGen XML configuration file. This tag indicates to LoadGen that you are using a message creator. The message creator portion of your configuration file would be similar to the following example:
<MessageCreator Mode="synchronous"> <SleepInterval>10</SleepInterval> <QueueLength>100</QueueLength> <Assembly>CustomMC.dll/CustomMC.CustomMC</Assembly> <TemplateFilePath> C:\Scenarios\MCTemplates\Scenario22.xml </TemplateFilePath> </MessageCreator>

In the example above, the <Assembly> tag directs LoadGen to load the custom message creator. This is the message creator you will need to use when you need a test that involves dynamic message generation. The custom message creator requires a template file, which is always specified in the <TemplateFilePath> tag. It also requires a message file with field names that indicate where the dynamic data should be inserted. The template files for the dynamic message creator must be written in XML. They begin and end with the <MessageCreator> tag. You specify the message file with the <MessageCreator> tag's SourceFilePath attribute. The custom message creator reads the message file and searches it for the field names specified in the template file. You define the fields in the template file with the <Field> tag. Your template file would resemble the following example:
<MessageCreator SourceFilePath="C:\Scenarios\MCMessages\Scenario22Data.xml"> <Field> <InitialValue>IDField_0</InitialValue> <DataType>guid</DataType> <InputFilePath></InputFilePath> <ContentMinSize>1</ContentMinSize> <ContentMaxSize>1024</ContentMaxSize> </Field> <Field> <InitialValue>_MSGIND_0</InitialValue> <DataType>integer</DataType> <InputFilePath></InputFilePath> <ContentMinSize>1</ContentMinSize> <ContentMaxSize>16</ContentMaxSize> </Field> </MessageCreator>

This example defines two fields. The field names appear in the <InitialValue> tag. Despite its name, this tag is not an initializer value. It is the name of the field. For this template file 13

to work properly, the identifiers IDField_0 and _MSGIND_0 must appear in the text file specified by the <MessageCreator> tag's SourceFilePath attribute. Note that the custom message creator is case sensitive. Therefore names in the message file, such as idfield_0 and IDField_0, are not seen as identical. The field identifier in the message file and the template file must match exactly. In addition to the field name, your template file must specify the data type for each field with the <DataType> tag. The valid data types are randomselection, integer, guid, or timestamp. If you specify randomselection data type for a field, LoadGen randomly chooses a value from a list that you supply. You store the possible values in a text file. The full path to the text file must appear in the <InputFilePath> tag. The values in the text file must be separated by the pipe (|) character, as in the following example:
BASEBALL|FOOTBALL|SKYDIVING

This example demonstrates an input file for a field that contains the names of sports. Each name is separated by the | character. When the custom message creator reads this file, it randomly assigns one of the three values to the corresponding field. To summarize, dynamic message creation requires at least one file, and possibly more. It needs an XML template file that defines one or more fields. It also may require a text file with a message that contains all of the field identifiers defined in the XML template file. If any of the fields have the data type randomselection, a corresponding text file must contain the possible values for that field. For more information about the tags used in the message creator's XML template file, see Template File Reference.

14

Load Generator Reference


This section provides a collection of reference pages that describe the XML tags used in LoadGen configuration files and message creator template files. Configuration File Reference Template File Reference

15

Configuration File Reference


This section describes the XML tags used in LoadGen configuration files.

16

XML tag
<Assembly> <CommonSection> <DstFilePath> <DstLocation> <LoadGenFramework> <LotSizePerInterval> <MessageCreator> <Monitor> <NumFiles> <NumThreadsPerSection> <OptimizeLimitFileSize> <Parameters> <QueueLength> <RetryInterval>

Description
Specifies the file name of the assembly to use in the test. Contains the common section of the configuration file. Contains the name of the folder to which message data is written. Specifies the parameters required to send messages to the destination location. Delineates the contents of the configuration file. Defines the number of messages to be sent by the thread between each sleep interval. Defines the message creator component. Selects the monitor to use to control the flow of message generation. Specifies the number of files to generate before stopping. Specifies how many threads the framework spawns to generate load for each section. Defines the size difference between small and large messages. Specifies parameter values for specific components. Specifies the maximum number of messages in a message creator queue. Specifies the number of seconds that the thread sleeps before attempting to transmit another message in the event of failure. Contains configuration information for a load generator. Specifies the number of milliseconds (ms) to sleep before transmitting the next batch of messages. Specifies the name of the file that contains the source message for the load generator component. Defines the end of a test run. Selects the XML file that the message creator component uses as a template for generating messages. Defines the upper and lower ranges that LoadGen must keep its data generation rate within. Selects which monitors are used to regulate the flow of data. Specifies one or more monitors to use for a test. Specifies the maximum number of seconds the test can run.

<Section> <SleepInterval> <SrcFilePath> <StopMode> <TemplateFilePath>

<ThresholdRange> <ThrottleCondition> <ThrottleController> <TotalTime>

17

<Transport>

Specifies the transport protocol used to send the test data.

<Assembly>
Specifies the file name of the assembly to use in the test.
<Assembly>assembly_name</Assembly>

where:
assembly_name

The name of the assembly to load. Remarks If your test uses a monitor, also called a throttle controller, to regulate the rate at which LoadGen produces test data, the test specifies the monitors assembly using this tag. It can also use this tag to specify the assembly containing the transport to use. In addition, you can use this tag to specify the location of the message creator for your test. This tag appears within the XML blocks delineated by the following tags:
<Monitor> <Transport>

Example The following example loads the SQLSpool monitor.


<Assembly>SQLMonitor.dll/SQLMonitor.SQLMonitorLib</Assembly>

This example loads the Rate monitor, which regulates the flow of data based on the rate at which it is produced.
<Assembly>RateMonitor.dll/RateMonitor.RateMonitorLib</Assembly>

18

<CommonSection>
Contains the common section of the configuration file.
< CommonSection >info</ CommonSection >

where:
info

The XML tags specifying the configuration data for the common section. Remarks The common section of the XML configuration file specifies the default values for load generators, message creators, and resource monitors (throttle controllers). It also specifies the transport that the load generator uses, as well as the throttle controller to use. Values specified within the <CommonSection> tag's XML block are used as default values. If the same values are repeated in a <Section> tag's XML block, those values override the <CommonSection> values. Thus values in the <CommonSection> can be considered default values. This tag appears within the XML blocks delineated by the following tag:
<LoadGenFramework>

The XML block specified by this tag contains the following tags:
<NumThreadsPerSection> <OptimizeLimitFileSize> <RetryInterval> <SleepInterval> <StopMode> <ThrottleController> <Transport>

Example The following example is an extract from the file HttpToHttpTwoWayLG.xml, which is one sample that comes with LoadGen.
<CommonSection> <OptimizeLimitFileSize>204800</OptimizeLimitFileSize> <NumThreadsPerSection>50</NumThreadsPerSection> <SleepInterval>200</SleepInterval> <LotSizePerInterval>20</LotSizePerInterval> <RetryInterval>10000</RetryInterval>

19

<StopMode Mode="Files"> <NumFiles>1000</NumFiles> </StopMode>

<Transport Name="HTTP"> <Assembly>HTTPTransport.dll/HTTPTransport.HTTPTransport</Assembly> </Transport>

<ThrottleController Mode="Disabled">

<Monitor Name="SQLSpool"> <Assembly>SQLMonitor.dll/SQLMonitor.SQLMonitorLib</Assembly> <ThresholdRange>25000-30000</ThresholdRange> <SleepInterval>5000</SleepInterval> <Parameters> server=SQLSVRNAME;Persist Security Info=True;Integrated Security=SSPI;database=BizTalkMsgBoxDb </Parameters>

<Parameters>Spool</Parameters> </Monitor>

<Monitor Name="Rate"> <Assembly>RateMonitor.dll/RateMonitor.RateMonitorLib</Assembly> <ThresholdRange>250-350</ThresholdRange> <SleepInterval>5000</SleepInterval> <Parameters></Parameters>

</Monitor>

<ThrottleCondition>Rate&amp;SQLSpool</ThrottleCondition> </ThrottleController> </CommonSection>

20

<DstFilePath>
Contains the name of the folder to which message data is written.
<DstFilePath>full_path_name</DstFilePath>

where: full_path_name The fully qualified path name of the folder where messages are written during the test. Remarks If your test writes load messages to files, it uses this tag to specify the destination folder. All messages generated by LoadGen are written to the folder you specify with this tag. This tag appears within the XML blocks delineated by the following tag:
<Parameters>

Example The following example directs LoadGen to write messages to the folder.
<Section Name="FileSection"> <SrcFilePath>C:\LoadGen\ConfigFiles\ConsoleConfigFiles\FileToFileLG.xml</SrcFilePath> <DstLocation> <Parameters> <DstFilePath>C:\Scenarios\FileToFile\Receive</DstFilePath> </Parameters> </DstLocation> </Section>

21

<DstLocation>
Specifies the parameters required to send messages to the destination location.
<DstLocation>location</DstLocation>

where:
location

The destination that the load test data will be sent to. Remarks This tag specifies the destination location of the message data. The format of the location depends on the load generator component. This tag appears within the XML blocks delineated by the following tags.
<Section>

The XML block specified by this tag contains the following tags.
<Parameters>

Example The following example illustrates how to write messages as files in a folder. It uses the <DstLocation> tag to specify the location of the output folder.
<Section Name="FileSection"> <SrcFilePath>C:\LoadGen\ConfigFiles\ConsoleConfigFiles\FileToFileLG.xml</SrcFilePath> <DstLocation> <Parameters> <DstFilePath>C:\Scenarios\FileToFile\Receive</DstFilePath> </Parameters> </DstLocation> </Section>

22

<LoadGenFramework>
Delineates the contents of the configuration file.
< LoadGenFramework >info</LoadGenFramework>

where:
info

The XML tags specifying the configuration data. Remarks The contents of XML configuration file that you use to specify the test parameters must occur between the <LoadGenFramework> and </LoadGenFramework> tags. The XML block specified by this tag contains the following tags:
<CommonSection> <Section>

Example The following example is the contents of the file FileToFileLG.xml, which is one of the samples that comes with LoadGen.
<LoadGenFramework> <CommonSection> <OptimizeLimitFileSize>204800</OptimizeLimitFileSize> <NumThreadsPerSection>5</NumThreadsPerSection> <SleepInterval>200</SleepInterval> <LotSizePerInterval>25</LotSizePerInterval> <RetryInterval>10000</RetryInterval>

<StopMode Mode="Files"> <NumFiles>5000</NumFiles> </StopMode>

<Transport Name="FILE"> <Assembly>FileTransport.dll/FileTransport.FileTransport</Assembly> </Transport>

<ThrottleController Mode="Custom"> <Monitor Name="File"> <Assembly> FileMonitor.dll/DropLocationFileMonitor.DropLocationFileMonitor </Assembly>

23

<ThresholdRange>1000-2000</ThresholdRange> <SleepInterval>1000</SleepInterval> <Parameters>C:\Scenarios\FileToFile\Receive</Parameters> </Monitor> <ThrottleCondition>File</ThrottleCondition> </ThrottleController> </CommonSection>

<Section Name="FileSection"> <SrcFilePath> C:\LoadGen\ConfigFiles\ConsoleConfigFiles\FileToFileLG.xml </SrcFilePath> <DstLocation> <Parameters> <DstFilePath>C:\Scenarios\FileToFile\Receive</DstFilePath> </Parameters> </DstLocation> </Section> </LoadGenFramework>

24

<LotSizePerInterval>
Defines the number of messages to be sent by the thread between each sleep interval.
<LotSizePerInterval>lot_size</LotSizePerInterval >

where:
lot_size

An integer specifying the number of messages to send in the active interval. Remarks To regulate the flow of data to BizTalk Server, you can specify how many milliseconds each thread sleeps before generating more messages. When the thread awakens, LoadGen uses the value specified by the <LotSizePerInterval> tag as the number of messages to generate before sleeping again. This tag appears within the XML blocks delineated by the following tags:
<CommonSection> <Section>

Example The following example makes LoadGen generate 25 messages during each active interval.
<LotSizePerInterval>25</LotSizePerInterval>

25

<MessageCreator>
Defines the message creator component.
<MessageCreator Mode = "creator_mode">info</MessageCreator>

where:
creator_mode

The message generation mode. For more information, see the "Attributes" section below.
info

The initialization parameters of the message creator component. Attributes


Mode

Selects synchronous or asynchronous message generation mode. Can be set to the following values. Value
synchronous asynchronous

Description
Messages are generated synchronously. Messages are generated asynchronously.

Remarks The LoadGen framework uses message creators to dynamically generate message data. Messages can be created in one of two modes; either synchronously or asynchronously. The mode is selected with the Mode attribute. This tag appears within the XML blocks delineated by the following tags:
<CommonSection> <Section>

The XML block specified by this tag contains the following tags:
<Assembly> <QueueLength> <SleepInterval> <TemplateFilePath>

Example The following example makes LoadGen create synchronous messages using a custom message creator.

26

<MessageCreator Mode="synchronous"> <SleepInterval>10</SleepInterval> <QueueLength>10</QueueLength> <Assembly>CustomMC.dll/CustomMC.CustomMC</Assembly> <TemplateFilePath> C:\Scenarios\BAMScenario\Setup\LoadGenConfig\BAMScenarioMC.xml </TemplateFilePath> </MessageCreator>

27

<Monitor>
Selects the monitor to use to control the flow of message generation.
<Monitor Name = "monitor_name">info</Monitor>

where:
mode

The name of the monitor to use. For more information, see the "Attributes" section below.
info

The initialization parameters of the monitor component. Attributes


Name Specifies the name of the monitor to use. Can be set to the following values.

Value
Rate Monitor

Description
Selects a monitor that regulates the flow of data based on a specific number of messages in a given amount of time. Selects a monitor that regulates the flow of data based on a specific number of rows in an SQL database table. Selects a monitor that regulates the flow of data based on a specific number of files in a given folder. Selects a monitor that regulates the flow of data based on a specific number messages in a Microsoft Message Queue. Selects a monitor that regulates the flow of data based on performance counters. Selects a monitor that regulates the flow of data based on the difference between two performance counters.

SQL Monitor

File Monitor MSMQ Monitor

PerfCounter Monitor PerfCrtDiff Monitor

Remarks The LoadGen framework uses monitors to regulate the flow of message data to the destination. Monitors are also called throttle controllers. This tag appears within the XML blocks delineated by the following tags.
<ThrottleController>

The XML block specified by this tag contains the following tags.
<Assembly> <ThresholdRange>

28

<SleepInterval> <Parameters>

Example The following example makes LoadGen create synchronous messages using the SQL monitor.
<Monitor Name="SQLSpool"> <Assembly>SQLMonitor.dll/SQLMonitor.SQLMonitorLib</Assembly> <ThresholdRange>15000-25000</ThresholdRange> <SleepInterval>1000</SleepInterval> <Parameters> server=BPI4X32PERF04;Persist Security Info=True;Integrated Security=SSPI;database=BizTalkMsgBoxDb </Parameters> <Parameters>Spool</Parameters> </Monitor>

29

<NumFiles>
Specifies the number of files to generate before stopping.
<NumFiles>total_files</NumFiles>

where:
total_files

An integer specifying the number of files to generate before stopping. Remarks To regulate the flow of data to BizTalk Server, you can specify how many data files to generate before stopping. This tag appears within the XML blocks delineated by the following tag:
<StopMode>

Example The following example tells LoadGen to generate 1,000 message files.
<StopMode Mode="Files"> <NumFiles>1000</NumFiles> </StopMode>

30

<NumThreadsPerSection>
Specifies how many threads the framework spawns to generate load for each section.
<NumThreadsPerSection>total_threads</NumThreadsPerSection>

where:
total_threads

An integer specifying the number of threads to spawn for each section. Remarks Each <section> tag in your configuration file can have one or more threads dedicated to the task it describes. You use the <NumThreadsPerSection> tag to control how many threads are created and assigned to each task described by a <section> tag. This tag appears within the XML blocks delineated by the following tag:
<CommonSection>

Example The following example dedicates five threads to each section.


<NumThreadsPerSection>5</NumThreadsPerSection>

31

<OptimizeLimitFileSize>
Defines the size difference between small and large messages.
<OptimizeLimitFileSize>file_size</OptimizeLimitFileSize>

where:
file_size

An integer specifying the file size in bytes that is the upper limit of a small file. Remarks The LoadGen framework differentiates between small and large files. Small files are files smaller than the file size specified by the <OptimizeLimitFileSize> tag. Files larger than that limit are considered large. How the framework reacts to small or large messages depends on which load generator is being used. For example, the File Transport load generator saves small messages to files. However, it streams large messages. If the size of the input data file to be delivered is below the threshold limit in this tag, the framework invokes the SendSmallMessage() method. If the size of the input data file to be delivered exceeds this limit the framework calls the SendLargeMessage() method. When building a custom transport component, which is derived from the ITransport interface, you need to implement both SendSmallMessage() and SendLargeMessage(). When you do, you can choose to handle large files differently if you so desire. Please refer to the FileTransport sample. This tag appears within the XML blocks delineated by the following tag:
<CommonSection>

Example The following example specifies that files larger than 204,800 bytes are considered large.
<OptimizeLimitFileSize>204800</OptimizeLimitFileSize>

32

<Parameters>
Specifies parameter values for specific components.
<Parameters>value_or_tag</Parameters>

where:
value_or_tag

The parameter value or tag containing the parameter value. Remarks The <Parameters> tag is used to communicate component-specific information to LoadGen components. Therefore, it can appear in XML blocks for monitors (also called throttle controllers), load generators, and message creators. The <Parameters> and </Parameters> tags can contain parameter values, such as integers or strings. They can also hold other XML tags that, in turn, contain the actual parameter values. The content and format of what appears inside the <Parameters> and </Parameters> tags is completely dependent on the component. This tag appears within the XML blocks delineated by the following tags:
<DstLocation> <MessageCreator> <Monitor>

Example The following example provides a configuration parameter for a monitor.


<Monitor Name="File"> <Assembly>FileMonitor.dll/DropLocationFileMonitor.DropLocationFileMonitor</Assembly> <ThresholdRange>1000-2000</ThresholdRange> <SleepInterval>1000</SleepInterval> <Parameters>C:\Scenarios\FileToFile\Receive</Parameters> </Monitor>

This example provides configuration parameters to a load generator.


<Section Name="MSMQRxQNonTxn"> <SrcFilePath> C:\LoadGen\ConfigFiles\ConsoleConfigFiles\FileToFileLG.xml </SrcFilePath> <DstLocation> <Parameters> <ServerName>TEST5</ServerName> <QueueName>RxQNonTxn</QueueName>

33

<TransportType>OS</TransportType> <IsTransactional>False</IsTransactional> </Parameters> </DstLocation> </Section>

34

<QueueLength>
Specifes the number of seconds that the thread sleeps before attempting to transmit another message in the event of failure.
<RetryInterval>interval</RetryInterval>

where:
interval

The number of milliseconds for the thread to sleep before attempting to transmit another message. Remarks If an error occurs when a load generator thread tries to transmit a message, the framework makes the thread go to sleep for the number of seconds specified by the <RetryInterval> tag. This helps to ensure availability whereby long-duration test runs, such as runs that take multiple days, are not invalidated due to external error conditions. For example, in the event that a network outage causes a connection failure, LoadGen continues to generate messages once the problem is resolved without having to be restarted. This tag appears within the XML blocks delineated by the following tags.
<CommonSection> <Section>

Example The following example sets the retry interval to 1,000 milliseconds.
<RetryInterval>1000<RetryInterval>

35

<RetryInterval>
Specifies the number of seconds that the thread sleeps before attempting to transmit another message in the event of failure.
<RetryInterval>interval</RetryInterval>

where:
interval

The number of seconds for the thread to sleep before attempting to transmit another message. Remarks If an error occurs when a load generator thread tries to transmit a message, the thread goes to sleep for the number of seconds specified. This helps to ensure availability whereby long-duration test runs, such as runs that take multiple days, are not invalidated due to external error conditions. For example, in the event that a network outage causes a connection failure, LoadGen continues to generate messages without having to be restarted. This tag appears within the XML blocks delineated by the following tags:
<CommonSection> <Section>

Example The following example sets the retry interval to 1,000 seconds.
<RetryInterval>1000<RetryInterval>

36

<Section>
Contains configuration information for a load generator.
<Section>section_info</Section>

where:
section_info

The collection of configuration information for the load generator. Remarks This tag specifies a collection of configuration information for a load generator component. The information in the XML block defined by this tag can override the information in the block for the <CommonSection> tag. This tag can also contain additional information not defined in the <CommonSection> tag. This tag appears within the XML blocks delineated by the following tag:
<LoadGenFramework>

The XML block specified by this tag contains the following tags:
<DstLocation> <LotSizePerInterval> <NumThreadsPerSection> <OptimizeLimitFileSize> <RetryInterval> <SleepInterval> <SrcFilePath> <StopMode>

Example The following example illustrates the use of the <Section> tag.
<Section Name="TwoWayLatencyHttpSectionLogToFile"> <SleepInterval>1000</SleepInterval> <LotSizePerInterval>1</LotSizePerInterval> <NumThreadsPerSection>1</NumThreadsPerSection> <StopMode Mode="Files"> <NumFiles>10</NumFiles> <TotalTime>3600</TotalTime> </StopMode> <SrcFilePath>C:\LoadGen\ConfigFiles\ConsoleConfigFiles\FileToFileLG.xml</SrcFilePath> <DstLocation>

37

<Parameters> <URL>http://localhost/TwoWayLatencyRxHTTP/BTSHTTPReceive.dll</URL> <IsUseIntegratedAuth>False</IsUseIntegratedAuth> <LatencyFileName> C:\Scenarios\TwoWayLatencyLoopback\Setup\Data\TwoWayLatencyHttp.Csv </LatencyFileName> <ResponseMsgPath> C:\Scenarios\TwoWayLatencyLoopback\Setup\Data </ResponseMsgPath> <!-- US-ASCII Or UTF-8 Or UTF-16BE Or UTF-16LE or UNICODE --> <DstEncoding></DstEncoding> </Parameters> </DstLocation> </Section>

38

<SleepInterval>
Specifies the number of milliseconds to sleep before transmitting the next batch of messages.
<SleepInterval>interval</SleepInterval>

where:
interval

The number of milliseconds for the thread to sleep before attempting to transmit another message. Remarks To regulate the flow of data to BizTalk Server, you can specify how many milliseconds each thread sleeps before generating more messages. The values specified in this tag indicate to the thread the length of time to sleep before becoming active again. When the thread awakens, LoadGen uses the value specified by the <LotSizePerInterval> tag as the number of messages to generate before sleeping again. This tag appears within the XML blocks delineated by the following tags:
<CommonSection> <Section>

Example The following example sets the sleep interval to 1 second.


<SleepInterval>1000</SleepInterval>

39

<SrcFilePath>
Specifies the name of the file that contains the source message for the load generator component.
<SrcFilePath>path</SrcFilePath>

where:
path

The fully qualified path to the message data. Remarks If your test does not use a message creator, you can have it use any text file as the source data for messages that it sends. This tag specifies the name of the text file to use. The framework reads the data from this file into a memory buffer. This memory buffer is then passed on to the load generator component via a call to the SendSmallMessage() method to be delivered to the destination location. If the size of the file exceeds the value specified in the <OptimizeLimitFileSize/> tag then this buffer is set to NULL and only the path in the <SrcFilePath> tag is passed to the load generator component using a call to the SendLargeMessage() method. The SendLargeMessage() method is expected to stream the data to the destination location. This tag appears within the XML blocks delineated by the following tags.
<Section>

Example The following example shows how to specify a source file path.
<SrcFilePath>C:\LoadGen\ConfigFiles\ConsoleConfigFiles\FileToFileLG.xml</SrcFilePath>

40

<StopMode>
Defines the end of a test run.
<StopMode Mode = "stop_mode">info</StopMode>

where:
stop_mode

The stop conditions for the test. For more information, see the "Attributes" section below.
info

The stop condition parameters. Attributes


Mode

Specifies whether the test generates a specific number of files or runs for a specific duration of time. Value
Files

Description
The test continues until a specified number of files or messages are sent, no matter how long it takes to send them. The test continues until a particular time period has elapsed, no matter how many messages have been sent.

Time

Remarks This tag defines the conditions under which a test stops. Tests can run either for a given length of time or until a certain number of files or messages have been sent. If the Mode attribute is set to Time, the time period is in seconds. Also, the XML block defined by the <StopMode> and </StopMode> contains <TotalTime>, which selects the duration of the time period that the test runs. When the Mode attribute is set to Files, the XML block defined by the <StopMode> and </StopMode> contains <NumFiles>, which sets the total number of files or messages sent during the test. This tag appears within the XML blocks delineated by the following tag:
<CommonSection>

The XML block specified by this tag contains the following tags:
<TotalTime> <NumFiles>

41

Example The following example demonstrates how to run a test for a specific period of time.
<StopMode Mode="Time"> <TotalTime>864000</TotalTime> </StopMode>

The following example shows how to stop a test after 1,000 messages are sent.
<StopMode Mode="Files"> <NumFiles>1000</NumFiles> </StopMode>

42

<TemplateFilePath>
Selects the XML file that the message creator component uses as a template for generating messages.
<TemplateFilePath>full_path_name</TemplateFilePath>

where: full_path_name The fully qualified path name of the XML file that contains the message template. Remarks During your tests, LoadGen can dynamically vary the data in messages it sends. To do so, it uses an XML template file. This tag provides the fully-qualified template file name. This template file is used to provide additional data required by the message creator component. The contents of this template file are dictated by the specific message creator component. This tag appears within the XML blocks delineated by the following tags.
<MessageCreator>

Example The following example shows how to specify an XML template file for a test.
<MessageCreator Mode="synchronous"> <SleepInterval>10</SleepInterval> <QueueLength>10</QueueLength> <Assembly>CustomMC.dll/CustomMC.CustomMC</Assembly> <TemplateFilePath> C:\Tests\Test0001\MessageTemplate.xml </TemplateFilePath> </MessageCreator>

43

<ThresholdRange>
Defines the upper and lower ranges that LoadGen must keep its data generation rate within.
<ThresholdRange>min-max</ThresholdRange>

where: min-max The minimum and maximum values for data generation. Remarks LoadGen generates messages at a rate whose range is specified with this tag. The meaning of the data in this tag depends on the type of monitor selected. For example, if your test uses the File monitor, the minimum and maximum values represent numbers of files. Alternatively, when you select the SQL monitor, the values represent numbers of messages. This tag appears within the XML blocks delineated by the following tags.
<Monitor>

Example The following example illustrates how to set the threshold range for the Rate, File, and SQLSpool monitors.
<ThrottleController Mode="Custom"> <Monitor Name="Rate"> <Assembly>RateMonitor.dll/RateMonitor.RateMonitorLib</Assembly> <ThresholdRange>14-15</ThresholdRange> <SleepInterval>1000</SleepInterval> </Monitor> <Monitor Name="File"> <Assembly> FileMonitor.dll/DropLocationFileMonitor.DropLocationFileMonitor </Assembly> <ThresholdRange>1000-2000</ThresholdRange> <SleepInterval>1000</SleepInterval> <Parameters>\\Server1\C$\Scenarios\Sceneriao5\Receive</Parameters> </Monitor> <Monitor Name="SQLSpool"> <Assembly>SQLMonitor.dll/SQLMonitor.SQLMonitorLib</Assembly> <ThresholdRange>15000-25000</ThresholdRange> <SleepInterval>1000</SleepInterval> <Parameters>

44

server=BPI4X32PERF04;Persist Security Info=True;Integrated Security=SSPI;database=BizTalkMsgBoxDb </Parameters> <Parameters>Spool</Parameters> </Monitor> <ThrottleCondition>Rate&File&SQLSpool</ThrottleCondition> </ThrottleController>

45

<ThrottleCondition>
Selects which monitors are used to regulate the flow of data.
<ThrottleCondition>monitor_list</ThrottleCondition>

where: monitor_list A list of one or more monitors used in the test. Remarks LoadGen uses monitors to control the flow of the data it generates. Tests can use zero or more monitors. With the <ThrottleCondition> tag, you can select which monitors your test uses. You can combine multiple monitors for a test to create a compound monitoring condition. For instance, your test can use both the Rate and File monitors to ensure that LoadGen creates a given number of message files at a specific rate. If you use multiple monitors, their names appear in the monitor list with an ampersand (&) between them. For instance, a test using the Rate and File monitors would require the value Rate&File in its monitor list. This tag appears within the XML blocks delineated by the following tag:
<ThrottleController>

Example The following example selects the Rate, File, and SQLSpool monitors.
<ThrottleController Mode="Custom"> <Monitor Name="Rate"> <Assembly>RateMonitor.dll/RateMonitor.RateMonitorLib</Assembly> <ThresholdRange>14-15</ThresholdRange> <SleepInterval>1000</SleepInterval> </Monitor> <Monitor Name="File"> <Assembly> FileMonitor.dll/DropLocationFileMonitor.DropLocationFileMonitor </Assembly> <ThresholdRange>1000-2000</ThresholdRange> <SleepInterval>1000</SleepInterval> <Parameters>\\Server1\C$\Scenarios\Sceneriao5\Receive</Parameters> </Monitor> <Monitor Name="SQLSpool"> <Assembly>SQLMonitor.dll/SQLMonitor.SQLMonitorLib</Assembly>

46

<ThresholdRange>15000-25000</ThresholdRange> <SleepInterval>1000</SleepInterval> <Parameters> server=BPI4X32PERF04;Persist Security Info=True;Integrated Security=SSPI;database=BizTalkMsgBoxDb </Parameters> <Parameters>Spool</Parameters> </Monitor> <ThrottleCondition>Rate&File&SQLSpool</ThrottleCondition> </ThrottleController>

47

<ThrottleController>
Specifies one or more monitors to use for a test.
<ThrottleController Mode = "controller_mode">info</ThrottleController>

where:
controller_mode

Enables or disables the monitors. For more information, see the "Attributes" section below.
info

An XML block containing one or more monitors. Attributes


Mode

Specifies whether the monitors are used or ignored when the test runs. Value
Custom Disabled

Description
Use the listed monitors. Ignore the monitors in the list.

Remarks This tag defines the monitors to be used to regulate the flow of data being generated. The Mode attribute can be either Custom or Disabled. If the mode is Disabled, all monitors in this tag's XML are ignored. A group of one or more <Monitor> sections must be defined within the <ThrottleController> and </ThrottleController> tags. If the mode is Custom, the monitors used are selected by the list in the <ThrottleCondition> tag. This tag appears within the XML blocks delineated by the following tag:
<CommonSection>

The XML block specified by this tag contains the following tag:
<Monitor>

Example The following example selects the Rate, File, and SQLSpool monitors.
<ThrottleController Mode="Custom"> <Monitor Name="Rate"> <Assembly>RateMonitor.dll/RateMonitor.RateMonitorLib</Assembly> <ThresholdRange>14-15</ThresholdRange>

48

<SleepInterval>1000</SleepInterval> </Monitor> <Monitor Name="File"> <Assembly> FileMonitor.dll/DropLocationFileMonitor.DropLocationFileMonitor </Assembly> <ThresholdRange>1000-2000</ThresholdRange> <SleepInterval>1000</SleepInterval> <Parameters>\\Server1\C$\Scenarios\Sceneriao5\Receive</Parameters> </Monitor> <Monitor Name="SQLSpool"> <Assembly>SQLMonitor.dll/SQLMonitor.SQLMonitorLib</Assembly> <ThresholdRange>15000-25000</ThresholdRange> <SleepInterval>1000</SleepInterval> <Parameters> server=BPI4X32PERF04;Persist Security Info=True;Integrated Security=SSPI;database=BizTalkMsgBoxDb </Parameters> <Parameters>Spool</Parameters> </Monitor> <ThrottleCondition>Rate&File&SQLSpool</ThrottleCondition> </ThrottleController>

49

<TotalTime>
Specifies the maximum number of seconds the test can run.
<TotalTime>time_limit</TotalTime>

where: time_limit The maximum number of seconds that the test can take. Remarks This tag is used in conjunction with the <StopMode> tag to limit a test to a period of time. To use the <TotalTime> tag, the Mode attribute of the <StopMode> tag must be set to Time. This tag appears within the XML blocks delineated by the following tag:
<StopMode>

Example The following example ensures that LoadGen runs its test for no more than 864,000 seconds.
<StopMode Mode="Time"> <TotalTime>864000</TotalTime> </StopMode>

50

<Transport>
Specifies the transport protocol used to send the test data.
<Transport>info</Transport>

where: info The XML block that specifies the transport's assembly. Remarks This loads the assembly containing the underlying transport protocol used by the load generator component. This tag appears within the XML blocks delineated by the following tags.
<CommonSection>

The XML block specified by this tag contains the following tag:
<Assembly>

Example The following example loads the HTTP transport component.


<Transport Name="HTTP"> <Assembly>HTTPTransport.dll/HTTPTransport.HTTPTransport</Assembly> </Transport>

The next example loads the WSE transport protocol.


<Transport Name="WSE"> <Assembly>WSETransport.dll/WSETransport.WSETransport</Assembly> </Transport>

51

Template File Reference


The reference pages in this section describe the XML tags used in template files that you use with the custom message creator component. XML tag
<ContentMaxSize> <ContentMinSize> <DataType> <Field> <InitialValue> <InputFilePath> <MessageCreator>

Description
Defines the maximum value that a dynamically generated data item can attain. Defines the minimum value that a dynamically generated data item can attain. Selects the data type of a variable field in a dynamically generated message. Defines a message field for which LoadGen generates information dynamically. Contains the unique identifier of the field. Defines the path for a file containing field values. Defines an XML template for the custom message creator component.

52

<ContentMaxSize>
Defines the maximum value that a dynamically generated data item can attain.
<ContentMaxSize>size_limit</ContentMaxSize>

where: size_limit The maximum value that can be assigned to a data item. Remarks This tag defines the maximum value that can be assigned to a dynamically generated data item. It can be used with integers, GUIDs, and time stamps. This tag appears within the XML blocks delineated by the following tag:
<Field>

Example The following example ensures that LoadGen assigns a value of no more than 1024 to the integer.
<Field> <InitialValue>IDField_0</InitialValue> <DataType>integer</DataType> <InputFilePath></InputFilePath> <ContentMinSize>1</ContentMinSize> <ContentMaxSize>1024</ContentMaxSize> </Field>

53

<ContentMinSize>
Defines the minimum value that a dynamically generated data item can attain.
<ContentMinSize>size_limit</ContentMinSize>

where: size_limit The minimum value that can be assigned to a data item. Remarks This tag defines the minimum value that can be assigned to a dynamically generated data item. It can be used with integers, GUIDs, and time stamps. This tag appears within the XML blocks delineated by the following tag:
<Field>

Example The following example ensures that LoadGen assigns a value of no less than 1 to the integer.
<Field> <InitialValue>IDField_0</InitialValue> <DataType>integer</DataType> <InputFilePath></InputFilePath> <ContentMinSize>1</ContentMinSize> <ContentMaxSize>1024</ContentMaxSize> </Field>

54

<DataType>
Selects the data type of a variable field in a dynamically generated message.
<DataType>type</DataType>

where: type The data type of the field. Valid values for this field are valid data types as shown in the following table. Value
guid integer

Description
The field is a globally unique identifier. The field is an integer that can contain values from 2147483648 through 2147483647 The field contains a value randomly selected from a list you provide. For more information, see Dynamic Message Creation. The field is a time stamp containing the date and time the message is generated.

randomselection

timestamp

Remarks This tag appears within the XML blocks delineated by the following tag:
<Field>

Example The following example defines a GUID field in a message.


<Field> <InitialValue>IDField_0</InitialValue> <DataType>guid</DataType> <InputFilePath></InputFilePath> <ContentMinSize>1</ContentMinSize> <ContentMaxSize>1024</ContentMaxSize> </Field>

55

<Field>
Defines a message field for which LoadGen generates information dynamically.
<Field>info</Field>

where: info A group of XML tags describing the field data. Remarks This tag defines a data item that LoadGen generates data for each time it creates a message. The field identifier, which is defined with the <InitialValue>tag, must exactly match the field identifier used in your message source file. For more information, see Dynamic Message Creation. This tag appears within the XML blocks delineated by the following tag:
<MessageCreator>

The XML block specified by this tag contains the following tags:
<ContentMaxSize> <ContentMinSize> <DataType> <InitialValue> <InputFilePath>

Example The following example instructs the message creator component to replace the contents of a field, whose unique identifier is IDField_0, with a randomly generated GUID.
<Field> <InitialValue>IDField_0</InitialValue> <DataType>guid</DataType> <InputFilePath></InputFilePath> <ContentMinSize>1</ContentMinSize> <ContentMaxSize>1024</ContentMaxSize> </Field>

56

<InitialValue>
Contains the unique identifier of the field.
<InitialValue>unique_id</InitialValue>

where: unique_id The unique identifier for the message's field. This identifier must exactly match the corresponding identifier in the message source file. Remarks When LoadGen creates dynamic messages, it uses a text file as its source for the message text. You specify the message file with the <MessageCreator> tag's SourceFilePath attribute. The custom message creator reads the message file and searches it for the field names specified in the template file. You define the fields in the template file with the <Field> tag. Each field must have a unique identifier delineated by the <InitialValue> tag. This tag appears within the XML blocks delineated by the following tags.
<Field>

Example The following example defines a field whose unique identifier is IDField_0.
<Field> <InitialValue>IDField_0</InitialValue> <DataType>guid</DataType> <InputFilePath></InputFilePath> <ContentMinSize>1</ContentMinSize> <ContentMaxSize>1024</ContentMaxSize> </Field>

57

<InputFilePath>
Defines the path for a file containing field values.
<InputFilePath>full_path_name </InputFilePath>

where: full_path_name The fully qualified path name of the file containing the values for the field. Remarks If you specify randomselection data type for a field, LoadGen randomly chooses a value from a list that you supply. You store the possible values in a text file. The full path to the text file must appear in the <InputFilePath> tag. The values in the text file must be separated by the | character, as in the example below.
BASEBALL|FOOTBALL|SKYDIVING

This tag appears within the XML blocks delineated by the following tag:
<Field>

Example The following example defines a field whose unique identifier is IDField_0.
<Field> <InitialValue>IDField_0</InitialValue> <DataType>randomselection</DataType> <InputFilePath>c:\Scenearios\DataValues\Field_0.txt</InputFilePath> </Field>

58

<MessageCreator>
Defines an XML template for the custom message creator component.
<MessageCreator>info</MessageCreator>

where: info A group of one or more fields for which LoadGen generates dynamic data. Remarks The template files for the dynamic message creator must be written in XML. They begin and end with the <MessageCreator> tag. You specify the message file with the <MessageCreator> tag's SourceFilePath attribute. The custom message creator reads the message file and searches it for the field names specified in the template file. You define the fields in the template file with the <Field> tag. The XML block specified by this tag contains the following tag:
<Field>

Example The following example illustrates an XML template file.


<MessageCreator SourceFilePath="C:\Scenarios\MCMessages\Scenario22Data.xml"> <Field> <InitialValue>IDField_0</InitialValue> <DataType>guid</DataType> <InputFilePath></InputFilePath> <ContentMinSize>1</ContentMinSize> <ContentMaxSize>1024</ContentMaxSize> </Field> <Field> <InitialValue>_MSGIND_0</InitialValue> <DataType>integer</DataType> <InputFilePath></InputFilePath> <ContentMinSize>1</ContentMinSize> <ContentMaxSize>16</ContentMaxSize> </Field> </MessageCreator>

59

Load Generator Samples


LoadGen comes with sample configuration files and a sample template file. Configuration File Samples Template File Sample

60

Configuration File Samples


The LoadGen sample configuration files can be found in the LoadGen\Program Files\ConfigFiles folder. The following files can be used as examples to help quickly create LoadGen configuration files that use the various transports. Sample name
File To File sample Http To Http One Way sample Http To Http Two Way sample MQ-Series sample MSMQ sample Soap To Soap One Way sample Soap To Soap Two Way sample Two Way Latency Loopback HTTP sample Two Way Latency Loopback SOAP sample Two Way Latency Loopback WSE sample WSE To WSE One Way sample WSE To WSE Two Way sample

File name
FileToFileLG.xml HttpToHttpOneWayLG.xml HttpToHttpTwoWayLG.xml MQSeriesLG.Xml MsmqLG.Xml SoapToSoapOneWayLG.xml SoapToSoapTwoWayLG.xml TwoWayLatencyLoopbackHTTPLG.Xml TwoWayLatencyLoopbackSOAPLG.Xml TwoWayLatencyLoopbackWSELG.Xml WseToWseOneWayLG.xml WseToWseTwoWayLG.xml

Description
Sends messages as files. Sends messages using HTTP. Sends messages using HTTP. Sends messages using IBM's MQ-Series. Sends messages using Message Queuing (MSMQ). Sends messages using SOAP. Sends messages using SOAP. Sends messages using HTTP and measures latency. Sends messages using SOAP and measures latency Sends messages using WSE and measures latency. Sends messages using WSE. Sends messages using WSE.

61

Template File Sample


The LoadGen sample message creator template file can be found in the file LoadGen\Program Files\ConfigFiles\Templates\TemplateFile_MC.xml. This sample shows how to write a message creator template file containing two fields. The first field is a GUID and the second field is an integer.

Copyright
The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property 2005 Microsoft Corporation. All rights reserved. Microsoft, MS-DOS, Windows, Windows Server, Windows Vista, BizTalk, and SharePoint are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. All other trademarks are property of their respective owners.

62

Anda mungkin juga menyukai