Since the OpenFAST 1.0.1 release, the OpenFAST binary distribution includes a few sample command line tools to play with. This set of tools includes a utility to measure the decoding performance of OpenFAST, download messages from a FAST server, and convert XML to and from a compressed FAST format.
Scripts to run the examples are located in the bin directory of the binary distribution. The scripts require the JAVA_HOME environment variable to set to the location of a valid Java installation. To see a list of options use the -? option.
The performance runner decodes a file containing fast-encoded data using the given templates. The results are given in total decoding time as well as average time it takes to decode a message. It is recommended to set the repeat to at least 3 as the first run is slower due to class loading.
option | long | description |
---|---|---|
-? | --help | Displays this message. |
-c | --continuous | Keep repeating the test until the process is killed |
-d | --data <arg> | FAST Encoded data |
-e | --error | Show stacktrace information |
-f | --format <arg> | Data format [hex|binary] default is binary |
-n | --ns | Enables namespace awareness |
-p | --preload | Preload data into memory instead of decoding directly from file |
-r | --repeat <arg> | Re process data file X number of times |
-t | --template <arg> | Message Template definition file |
To run the performance runner try:
perf.bat -t D:\data\templates.xml -d D:\data\data.fast -p -r 3
By default the format of the FAST data file is expected to be binary. There is also support for files encoded using hexadecimal byte values. Use the "-f hex" option to use this format.
The message consumer tool is used to test OpenFAST compatibility with a given data provider's FAST stream.
options | long | description |
---|---|---|
-? | --help | Displays this message |
-e | --error | Show stacktrace information |
-h | --host <arg> | The host name of the server (or group name for multicast) |
-m | --template <arg> | Message template definition file |
-p | --port <arg> | Port to connect to |
-r | --protocol <arg> | Protocol [tcp|udp] defaults to tcp |
consumer.bat -h localhost -p 2001 -m templates.xml
consumer.bat -t udp -h 224.0.0.1 -p 30000 -m templates.xml
The XML Conversion utilities are a proof of concept implementation of the proposed FAST extension Map operator. The Map operator is used to compress XML element names and attribute names.
The XML Conversion tools simply takes an input file and output file.
xml2fast.bat data.xml data.fast
fast2xml.bat data.fast data.xml
The bin
directory contains template and data files that the producer and consumer examples can use to communicate.
In separate shells, run:
producer.bat -p 13000 -t FASTTestTemplate.xml -x data.xml
consumer.bat -p 13000 -t FASTTestTemplate.xml
In separate shells, run:
sh producer.sh -p 13000 -t FASTTestTemplate.xml -x data.xml
sh consumer.sh -p 13000 -t FASTTestTemplate.xml