esp_playback

Loads data into an Event Stream Processor project at a specified rate.

Use esp_playback to test a project. It can send data with a play rate, and upload data to a project from different sources.

Currently supported formats are ESP XML, comma-separated values, ESP binary, ESP recorder, KDB, and ODBC sources.
Note: The ODBC driver supports SAP Sybase IQ and ASE databases. You can also connect to other ODBC-compatible data sources such as Oracle, DB2, and MySQL.
This tool automatically displays updates regarding the status of the data upload into ESP project when the command has been initiated. Each update displays (in order): a timestamp (in square brackets) in seconds, the number of events uploaded into a project, if any errors have occurred, and the total percentage of events uploaded so far. By default, the esp_playback tool displays an update every 5 seconds, but you can use the -R option to specify a custom interval. Below is an example where output is set to report every 2 seconds:
[1329258744] started
[1329258744] complete: 0 (success) 0 (errors) 0 (%)
[1329258746] complete: 1 (success) 0 (errors) 33 (%)
[1329258748] complete: 2 (success) 0 (errors) 66 (%)
[1329258750] complete: 3 (success) 0 (errors) 100 (%)
[1329258750] stopped
When a timestamp accompanied with a ‘stopped’ output is displayed, the utility has finished uploading events into ESP project. If any errors occur during the upload, an error message indicates the issue.

You can also slow down or speed up the rate of the playback. Use the -R option to specify the desired rate, either in rows/millisecond, or at a rate determined by the values in a timestamp/datetime column in input data. If you use the latter method, you can specify a timescale rate to speed up or slow down the playback.

Because esp_playback is a testing tool, there are various reasons for slowing down or speeding up the playback. Typically, you adjust the playback rate to verify your calculations and collection of data. When you're confident that your project is configured correctly, you can speed up the playback rate to simulate the anticipated incoming rate of actual data to ensure your project can handle the throughput.

Note that the input speed may influence your calculations. The example below demonstrates how modifying input speed can change the results of calculations due to timing discrepancies. The CCL code below sums the number of shares, numShares, and averages the price, price, of the input from the cbret_006 window.

create schema sharesSchema (
    tradeId integer,
    symbol string,
    tradeDate date,
    numShares integer,
    price float
);

CREATE  MEMORY  STORE "store" PROPERTIES  INDEXTYPE ='tree',  INDEXSIZEHINT =8;

create input window cbret_006a
    schema sharesSchema
    primary key(tradeId)
    STORE "store"
;
create output window cbret_006
    primary key deduced
    as
    select a.tradeId, a.symbol, a.tradeDate,
        sum(a.numShares) as numShares,
        avg(a.price) as price
        from cbret_006a a
        keep 1 seconds per (symbol)
        group by a.symbol
;

A sample input of three lines of XML records to be read. The ESP_OPS value i indicates that all three records have an insert opcode.

<cbret_006a ESP_OPS="i"  tradeId="1" symbol="EBAY" tradeDate="2000-05-04T12:00:01" numShares="500" price="150.0" />
<cbret_006a ESP_OPS="i"  tradeId="2" symbol="EBAY" tradeDate="2000-05-04T12:00:02" numShares="100" price="50.625" />
<cbret_006a ESP_OPS="i"  tradeId="3" symbol="EBAY" tradeDate="2000-05-04T12:00:04" numShares="1000" price="16.875" />

esp_playback is run below without modifying the playrate and the output is written by executing esp_subscribe connected to the cbret_006 window.

esp_playback -p remoteBox:19011/ws1/project1 -c sybase:sybase -C espxml:sum/input.xml
esp_subscribe  -p remoteBox:19011/ws1/project1 -c sybase:sybase  -s cbret_006:

The output is a single XML record with the correct share sum and average price of the three input records.

<cbret_006 ESP_OPS="i"  tradeId="3" symbol="EBAY" tradeDate="2000-05-04 12:00:04" numShares="1600" price="72.500000"/>

esp_playback is run below with the -R option changing the playrate to 1 record per 4000 milliseconds (4 seconds). The output is written to the standard output by executing esp_subscribe connected to the cbret_006 window.

esp_playback -p remoteBox:19011/ws1/project1 -c sybase:sybase  -C espxml:sum/input.xml -R 1:4000 -t1
esp_subscribe -p remoteBox:19011/ws1/project1 -c sybase:sybase  -s cbret_006:

The output of this execution of esp_playback is 3 XML records identical to the input file.

<cbret_006 ESP_OPS="i"  tradeId="1" symbol="EBAY" tradeDate="2000-05-04 12:00:01" numShares="500" price="150.000000"/>
<cbret_006 ESP_OPS="i"  tradeId="2" symbol="EBAY" tradeDate="2000-05-04 12:00:02" numShares="100" price="50.625000"/>
<cbret_006 ESP_OPS="i"  tradeId="3" symbol="EBAY" tradeDate="2000-05-04 12:00:04" numShares="1000" price="16.875000"/>
Note that the project only keeps each symbol for a total of 1 second, as specified in the CCL code by the line
keep 1 seconds per (symbol)
As a result of slowing down the playrate to 1 record per 4 seconds, the share sum and average price were calculated differently since the project only ever stored the share sum and average price of 1 record at a time.

Syntax

esp_playback -p [<host>:]<port>/workspace-name/project-name -c user[:password] [OPTION...]

Required Arguments

Options

Some of these options require file paths. When entering file paths on Windows, use forward slashes instead of back slashes.

Examples