CTmousetrack generates interactive live data. It captures mouse movement and writes CloudTurbine “x” and “y” channels of mouse cursor position. A non-CloudTurbine UDP output mode is also supported. The CTmousetrack class is contained within CTexample.jar.
Usage:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
java -cp CTexample.jar CTmousetrack -h usage: CTmousetrack -b <points per block> Number of points per block; UDP output mode will use 1 point/block; default = 10. -dt <samp interval msec> Sampling period in msec; default = 10. -h,--help Print this message. -host <host[:port]> Host:port when writing via FTP, HTTP, HTTPS, UDP. -o <base output dir> Base output directory when writing data to local folder (i.e., this is the location of CTdata folder); default = ".\CTdata". -s <source name> Name of source to write data to; default = "CTmousetrack". -t <trim time sec> Trim (ring-buffer loop) time (sec); this is only used when writing data to local folder; specify 0 for indefinite; default = 0.0. -u <username,password> Comma-delimited username and password when writing to CT via FTP or HTTPS. -w <write mode> Type of write connection; one of LOCAL, FTP, HTTP, HTTPS, UDP; all but UDP mode write out to CT; default = LOCAL. -x,--debug Enable CloudTurbine debug output. NOTE: UDP output is a special non-CT output mode where single x,y points are sent via UDP to the specified host:port. |
Further information on these command line arguments is provided in the table below.
Command line option | Description |
---|---|
-b | Number of points per block; i.e., the number of samples per channel in each output ZIP file. This is forced to 1 for UDP output mode (i.e., each output UDP packet will contain a single x,y data point). |
-dt | The (approximate) sampling period in milliseconds; that is, the amount of time between sampled data points. |
-h | Print the command line help message (as shown above). |
-host | The server host and port when writing via FTP, HTTP or HTTPS or UDP. |
-o | Location of the “CTdata” directory. Used when writing CT data to a local folder (i.e., “-w LOCAL”). Output CT data will be saved under this base CloudTurbine data directory. |
-s | Name of the output source. |
-t | Only maintain the specified amount of data (seconds) in the CloudTurbine source; older data is deleted automatically. Used when writing CT data to a local folder (i.e., “-w LOCAL”). |
-u | Comma-delimited username and password, used when writing CT data via FTP or HTTPS (not used when write mode is LOCAL, HTTP or UDP). |
-w | Specifies mode for writing out data; one of LOCAL, FTP, HTTP, HTTPS, or UDP. Data can be directly written to a local folder or to a local or remote server (ftp, http, https, udp). Data written via http or https can be captured using CTweb server. Data written via udp can be captured using UDP2CT. |
-x | Turn on CloudTurbine debugging. |
As an example, if writing CloudTurbine data (i.e., the output mode (“-w”) is LOCAL, FTP, HTTP, or HTTPS) and the sample period is 10msec (“-dt 10”) and the number of points per block is 100 (“-b 100”) then a ZIP file is written (approximately) once per second, containing 100 samples for each channel (“x” and “y”) at 0.01 sec interval each.
Data can optionally be written to a specified host and port via UDP. Each UDP packet contains a 5 byte header (“MOUSE”), a long integer containing the epoch timestamp (in milliseconds) and single-precision floating point values for x and y mouse position. If desired, this data can be captured and parsed by UDP2CT.
See the GitHub source code for how simple it is to make a CT source such as this.