ttestSuite is a multithreaded implementation of Welch's T-test in go. It reads the data from wfm files and saves the result as a csv files. The WFM file parser is very basic and was only tested with an Tektronix MSO64. For plotting you can use external tools like Matlab.
ttestSuite supports two usage modes: normal and streaming.
In "normal mode", it is assumed that all the trace files are already stored to disk.
The "streaming mode" is intended to process files as they are stored by the oscilloscope.
For this, ttestSuite provides two http endpoints. See examples/measure-dummy.py to get
and idea of how to implement this in your measurement script.
Run go build ./cmd/ttestSuite to build. This will create the main binary ttestSuite.
For a basic usage is suffices to pass the following arguments:
-traceFolderpoint to a folder with WFM files namedtrace (x).wfmwhere x in the range[1,traceFileCount].-caseFilename of a text file intraceFolder, containing as many lines as traces (not trace/wfm files). Each line may either contain0to indicate that this trace belongs to the fixed set, or1to indicate that it belongs to the random set.-traceFileCountnumber of case files that should be processed.
To activate the streaming mode use the -streamFromAddr <ip:port> argument .
Now ttestSuite is listening <ip:port> waiting to be controlled via two http endpoints (see examples/measure-dummy.py).
In the streaming mode -traceFileCount is not needed, as it is epxected to be sent by the measurement script.
Beside printing some basic statistics on the CLI, ttestSuite comes with Promethreus prometheus
based metrics to monitor the throughput of the tool itself as well as the maximal T-test value, and the normalized cross-correlation.
For the latter, we first wait for the first 5% of the expected traces to complete. Then we use them as a reference
to compare against periodically selected trace files. The correlation measure is
dot(a,b)/sqrt(dot(a,a)*dot(b,b)).
To use, first setup Promethreus and Prometheus Pushgateway.
To visualize the metrics I used Grafana. See examples/monitoringSetup for a docker-compose file
,and an example Grafana dashboard (use ttestSuite for the job variable in the Grafana dashboard).
ttestSuite uses a pipeline for processing. A feeder reads the input files into an internal
buffer of size -fileBufferInGB which gets drained by -numWorkers. A periodic "Buffer Usage" message
will inform you about the fill level of the buffer (also visible in the Prometheus metrics). If the buffers runs full you can either increase the
worker count (if you have reamining cpu cores) or increase the buffer size. Note that depending on the computed
payload function increasing the workers can also cost significant amount of RAM.
Contributions are appreciated! Feel free to submit issues and pull requests.
If you require a different parser for the files take a look at the interface defined wfm/wfmParser.go.
If you would like to compute a different function than Welch's T-test, take a look at the interface defined in
payloadComputation/registry.go