Documentation ¶
Overview ¶
Package parser has funcs for parsing ingestion files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrFileShouldBeSkipped is returned if a file should be skipped. ErrFileShouldBeSkipped = errors.New("File should be skipped.") )
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parses file.Files contents into a form suitable for writing to trace.Store.
func New ¶
func New(instanceConfig *config.InstanceConfig) (parser *Parser, err error)
New creates a new instance of Parser for the given branch names and invalid chars of parameter key/value
func (*Parser) Parse ¶
func (p *Parser) Parse(ctx context.Context, file file.File) ([]paramtools.Params, []float32, string, error)
Parse the given file.File contents.
Returns two parallel slices, each slice contains the params and then the float for a single value of a trace.
The returned error will be ErrFileShouldBeSkipped if the file should not be processed any further.
The File.Contents will be closed when this func returns.
func (*Parser) ParseCommitNumberFromGitHash ¶
func (p *Parser) ParseCommitNumberFromGitHash(gitHash string) (types.CommitNumber, error)
ParseCommitNumberFromGitHash parse commit number from git hash. this method will be used to get integer commit number from string git hash. For example: "git_hash": "CP:727901", the commit number will be 727901
func (*Parser) ParseTryBot ¶
ParseTryBot extracts the issue and patch identifiers from the file.File.
The issue and patch values are returned as strings. If either can be further parsed as integers that will be done at a higher level.
type Samples ¶
type Samples struct { Params paramtools.Params Values []float64 }
Samples contain multiple runs of the same test, where Params describes the test.
type SamplesSet ¶
SamplesSet maps trace names to Samples for that trace.
func GetSamplesFromLegacyFormat ¶
func GetSamplesFromLegacyFormat(b *format.BenchData) SamplesSet
GetSamplesFromLegacyFormat returns a map from trace id to the slice of samples for that test.