TagStreamerUseCaseScenarios

From RifidiWiki

Revision as of 21:10, 6 February 2008 by Andreas (Talk | contribs)

Jump to: navigation, search

Use Case: Load Testing multiple readers one batch

This is describing a use case scenario for a load testing with multiple readers and a batch insert every 1s for 40 times into 3 scenarios at a time. After this is finished it will insert a batch every 2s in only one scenario. Once a batch entered the scenario it will execute it's actions on each of the PatchItem's and then move further to the next PathItem. In this case each scenario only has one PathItem which is a reference to a virtual LLRP reader emulated by RifidiEmulator.

Scenarios

The scenarios file is a list of one or more scenarios. Each scenario contains one or more readers on which batches will be executed. You can think of a scencario as a path along an assembly line: a certain group of tags (or a batch, which is more like a script of actions) gets executed on a particular reader, and then moves on to the next reader. In this case, three scenarios are defined, all of which have one reader only. The traveltime is the time that it takes for one tag to reach the next reader in a scenario once it has left the previous one. In this case, the traveTime for each of the scenarios is set to zero because there is only one reader in each scenario.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<scenarios>
	<scenario>
		<id>1</id>
		<pathItem>
			<readerID>0</readerID>
			<travelTime>0</travelTime>
		</pathItem>
	</scenario>
	<scenario>
		<id>2</id>
		<pathItem>
			<readerID>1</readerID>
			<travelTime>0</travelTime>
		</pathItem>
	</scenario>
	<scenario>
		<id>3</id>
		<pathItem>
			<readerID>2</readerID>
			<travelTime>0</travelTime>
		</pathItem>
	</scenario>
</scenarios>

Components

The components file contains one or more descriptions of readers. It matches a virtual reader up with an ID that is used in the scneario. In this example, we have defined three different LLRP readers for use in the scenarios.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<components>
    <readerComponents id="0">
        <reader>
            <numAntennas>1</numAntennas>
            <numGPIs>4</numGPIs>
            <numGPOs>4</numGPOs>
            <propertiesMap>
                <entry>
                    <key>llrp_inet_address</key>
                    <value>127.0.0.1:5084</value>
                </entry>
                <entry>
                    <key>inet_address</key>
                    <value>127.0.0.1:10101</value>
                </entry>
                <entry>
                    <key>servermode</key>
                    <value>true</value>
                </entry>
            </propertiesMap>
            <readerClassName>org.rifidi.emulator.reader.llrp.module.LLRPReaderModule</readerClassName>
            <readerName>LLRPReader</readerName>
        </reader>
    </readerComponents>
    <readerComponents id="1">
        <reader>
            <numAntennas>1</numAntennas>
            <numGPIs>4</numGPIs>
            <numGPOs>4</numGPOs>
            <propertiesMap>
                <entry>
                    <key>llrp_inet_address</key>
                    <value>127.0.0.1:5085</value>
                </entry>
                <entry>
                    <key>inet_address</key>
                    <value>127.0.0.1:10102</value>
                </entry>
                <entry>
                    <key>servermode</key>
                    <value>true</value>
                </entry>
            </propertiesMap>
            <readerClassName>org.rifidi.emulator.reader.llrp.module.LLRPReaderModule</readerClassName>
            <readerName>LLRPReader</readerName>
        </reader>
    </readerComponents>
    <readerComponents id="2">
        <reader>
            <numAntennas>1</numAntennas>
            <numGPIs>4</numGPIs>
            <numGPOs>4</numGPOs>
            <propertiesMap>
                <entry>
                    <key>llrp_inet_address</key>
                    <value>127.0.0.1:5086</value>
                </entry>
                <entry>
                    <key>inet_address</key>
                    <value>127.0.0.1:10103</value>
                </entry>
                <entry>
                    <key>servermode</key>
                    <value>true</value>
                </entry>
            </propertiesMap>
            <readerClassName>org.rifidi.emulator.reader.llrp.module.LLRPReaderModule</readerClassName>
            <readerName>LLRPReader</readerName>
        </reader>
    </readerComponents>
</components>

Batch

The batch is a sequence of commands that should be executed on a reader when it is being processed on a reader. The batch is made up of one or more of the following kinds of commands: a waitAction is a time that the batch should wait. The TagAction is a set of tags that should be exposed to the reader. TH GPI Action toggles the reader's GPI. The TagAction consists of an execDuration (how long the tags should be on the reader), a number (the number of tags in this tag action), a tagType, a prefix, and a tag Generation. Also it contains a boolean regeration variable that will force the set of tags to be regenerated each time it is exposed to a reader.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<batch id="1">
    <waitAction>
        <waitTime>100</waitTime>
    </waitAction>
    <tagAction>
        <execDuration>200</execDuration>
        <number>20</number>
        <prefix>eef</prefix>
        <tagGen>GEN2</tagGen>
        <tagType>CustomEPC96</tagType>
        <regenerate>false</regenerate>
    </tagAction>
    <waitAction>
        <waitTime>100</waitTime>
    </waitAction>
    <gpiAction>
        <port>0</port>
        <signal>true</signal>
    </gpiAction>
</batch>

LoadTestSuite

The Load Test Suite defines how the different scenarios are combined together with batches to be run. The LoadTestSuite is made up of fileUnits and testUnits. FileUnits are pointers to particular xml file (like the component.xml, scenario.xml, and batch.xml) to be loaded. The testUnits match up a batch with a list of scenarios. In this example, batch with ID 1 will be executed on scenarios 1, 2, and 3 in parallel 40 times each. After that the next test unit will be run.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<loadTestSuite>
    <fileUnits>
        <fileName>scenario.xml</fileName>
        <fileType>SCENARIO</fileType>
    </fileUnits>
    <fileUnits>
        <fileName>batch.xml</fileName>
        <fileType>BATCH</fileType>
    </fileUnits>
    <fileUnits>
        <fileName>components.xml</fileName>
        <fileType>COMPONENT</fileType>
    </fileUnits>
    <testUnit>
        <loop>40</loop>
        <batchID>1</batchID>
        <rampTime>1000</rampTime>
        <scenarios>
            <id>1</id>
            <id>2</id>
            <id>3</id>
        </scenarios>
    </testUnit>
    <testUnit>
        <batchID>1</batchID>
        <rampTime>2000</rampTime>
        <count>10</count>
        <scenarios>
            <id>1</id>
        </scenarios>
    </testUnit>
</loadTestSuite>
Personal tools