...and everything in between RSS 2.0
# Thursday, July 17, 2008

When developing applications, at some point in the dev cycle we want to know how the system will perform under load. In BizTalk RFID land it is no different. In fact, in BizTalk RFID implementations we often deal with devices capable of raising hundreds of reads every second. So how do we go about testing these?

I'm a big fan of using physical devices during development rather than device emulation, but when it comes to load testing we need to present hundreds of tags to the reader and no matter what I try I just can't get the work experience kid to act fast enough! But instead of using a emulated device, what if we could raise tag read events programmatically and have our RFID Process consume them? Surely then we could get enough events to constitute a decent load test.

So how do we go about pushing tag read events through our RFID process in code?

We do this using the BizTalk RFID management API's, namely the ProcessManagerProxy. In just a few lines of code we can connect to the RFID process we want to test and "submit" a tag read event to the event pipeline. To get up and running with this you will need to add the following references to your project: (all can be found in %RFIDINSTALLDIR%\bin)

  • Microsoft.Rfid.Design.dll
  • Microsoft.Rfid.ManagementWebServiceProxies.dll
  • Microsoft.Rfid.SpiSdk.dll
  • Microsoft.Rfid.Util.dll

Then, in three lines of code you can create your tag read event, connect to your process, and submit your event for processing;

// Create the tag read event to submit
TagReadEvent tag = new TagReadEvent(  HexUtilities.HexDecode(strTagID), 
                                      TagType.EpcClass1Gen2, 
                                      HexUtilities.HexDecode(strTagData), 
                                      strTagSource,
                                      DateTime.Now, null, null );
                                                                     
// Connect to the local RFID server
ProcessManagerProxy proxy = new ProcessManagerProxy("localhost");

// Submit event to the event pipeline
proxy.AddEventToProcessPipeline( strRfidProcessName, tag, strLogicalDeviceName);

And that's it.

For my needs, I created a quick Win forms app that retrieved a list of registered tag id's from a SQL DB and submitted them to my RFID process at configured intervals:

rfid process tester

I added a few variables to adjust the interval between tag read events, the number of events to submit each interval, and the number of duplicates to send for each tag id. These variables (used when looping through the set of tag id's) combine to give me a good approximation to a real, high volume environment.

Firing up good old perfmon and adding the RFID:Process counters, I ran through a number of test configurations to make sure my RFID process performs well under high load. (Note: the RFID process you are monitoring must be running before you can add the counters). Of most interest is the Tags In Queue counter. This tells me when my process is not performing well and tags are being queued up waiting to be processed (not good in real-time processing systems). We want this to be flat-lined most of the time.

perfmon

Another good idea is to use the SQL Sink EH component while testing. After running your tests you can simply and easily calculate event processing latency by executing the following T-SQL query against the tagevents table in the RfidSink DB.

SELECT AVG(DATEDIFF(ms, sinktime, tagtime)) FROM tagevents;

A while back, Mick posted about a great article on MSDN around performance and capacity planning for BizTalk RFID. Some goodness in that article so check it out as well.

Thursday, July 17, 2008 11:23:12 PM (AUS Eastern Standard Time, UTC+10:00)  #    - Trackback
BizTalk RFID
Tracked by:
"TECHED: RFID Palava" (Craig Bailey on Microsoft) [Trackback]
Navigation
Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012
Breeze
Sign In
Statistics
Total Posts: 44
This Year: 1
This Month: 0
This Week: 0
Comments: 182
Themes
Pick a theme:
All Content © 2012, Breeze
DasBlog theme 'Business' created by Christoph De Baene (delarou)