parser

package
v0.0.0-...-2ad2f98 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: BSD-3-Clause Imports: 11 Imported by: 1

Documentation

Overview

Package parser parses incoming JSON files from Android Testing and converts them into a format acceptable to Skia Perf.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrIgnorable is returned from Convert if the file can safely be ignored.
	ErrIgnorable = errors.New("File should be ignored.")
)

Functions

This section is empty.

Types

type Converter

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

Converter converts a serialized *Incoming into an *format.BenchData.

func New

func New(lookup Lookup) *Converter

New creates a new *Converter.

func (*Converter) Convert

func (c *Converter) Convert(incoming io.Reader, txLogName string) (map[string]string, string, []byte, error)

Convert the serialize *Incoming JSON into a JSON serialized format that Perf supports. Also return the global keys and the buildID from the parsed file.

type Incoming

type Incoming struct {
	BuildId        string `json:"build_id"`
	BuildFlavor    string `json:"build_flavor"`
	Branch         string `json:"branch"`
	DeviceName     string `json:"device_name"`
	SDKReleaseName string `json:"sdk_release_name"`
	JIT            string `json:"jit"`

	// Metrics is a map[test name]map[metric]value, where value
	// is a string encoded float, thus the use of json.Number.
	Metrics map[string]map[string]json.Number `json:"metrics"`
}

Incoming is the JSON structure of the data sent to us from the Android testing infrastructure.

func Parse

func Parse(incoming io.Reader) (*Incoming, error)

Parse the 'incoming' stream into an *Incoming struct.

type Lookup

type Lookup interface {
	Lookup(buildid int64) (string, error)
}

Lookup is an interface for looking up a git hashes from a buildid.

The *lookup.Cache satisfies this interface.

Jump to

Keyboard shortcuts

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