traceSource

package
Version: v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReceiver

func NewReceiver() *receiver

func ParseCaseLog

func ParseCaseLog(rawLog []byte) ([]int, error)

ParseCaseLog expects the raw bytes of case log file ( num traces lines containing either 1 or 0. 1 stands for random case, 0 for fixed case

Types

type StreamingTraceFileReader

type StreamingTraceFileReader struct {
	// contains filtered or unexported fields
}

StreamingTraceFileReader does not expect all files to be available from the start but allows to receive updates about file availability count. Idea is to process files as they come in from the oscilloscope. Number of files must be known in advance for now

func NewStreamingTraceFileReader

func NewStreamingTraceFileReader(fileCount int, folderPath, caseFileName string, nextFile <-chan string) *StreamingTraceFileReader

func (*StreamingTraceFileReader) GetBlock

func (recv *StreamingTraceFileReader) GetBlock(nr int) ([]byte, []int, error)

GetBlock may block if file denoted by nr is not yet available

func (*StreamingTraceFileReader) TotalBlockCount

func (recv *StreamingTraceFileReader) TotalBlockCount() int

type TraceBlockReader

type TraceBlockReader interface {
	//TotalBlockCount returns the total number of trace blocks/files
	TotalBlockCount() int
	//GetBlock reads the block identified by nr and returns raw file along with case markers
	GetBlock(nr int) ([]byte, []int, error)
}

TraceBlockReader is the common interface providing raw(unparsed) trace file data

type TraceFileReader

type TraceFileReader struct {
	// contains filtered or unexported fields
}

TraceFileReader reads trace files folderPath using the passed idToFileName function to generate on order on the files. All files must be available at instantiation time

func NewDefaultTraceFileReader

func NewDefaultTraceFileReader(fileCount int, folderPath, caseFileName string, reverseOrder bool) (*TraceFileReader, error)

NewDefaultTraceFileReader assumes "trace (x).wfm" with x in [1,totalFileCount] as the naming scheme. If reverseOrder is set GetBlock(nr) will return the trace (and case data) for "trace (totalFileCount-nr).wfm" instead of "trace (nr+1).wfm"

func (*TraceFileReader) GetBlock

func (recv *TraceFileReader) GetBlock(nr int) ([]byte, []int, error)

func (*TraceFileReader) TotalBlockCount

func (recv *TraceFileReader) TotalBlockCount() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL