parser

package
v0.0.0-...-0ec319e Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package parser has funcs for parsing ingestion files.

Index

Constants

This section is empty.

Variables

View Source
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

func (p *Parser) ParseTryBot(file file.File) (types.CL, string, error)

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

type SamplesSet map[string]Samples

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.

func (SamplesSet) Add

func (s SamplesSet) Add(in SamplesSet)

Add all the Samples from 'in'.

Jump to

Keyboard shortcuts

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