entity

package
v0.0.0-...-1327151 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package entity defines types for core application objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Benchmark

type Benchmark struct {
	Package    *Package
	FullName   string
	Name       string
	Parameters map[string]string
	Unit       string
}

func (*Benchmark) UUID

func (b *Benchmark) UUID() uuid.UUID

type Commit

type Commit struct {
	SHA        string
	Tree       string
	Parents    []string
	Author     Person
	AuthorTime time.Time
	Committer  Person
	CommitTime time.Time
	Message    string
}

type DataFile

type DataFile struct {
	Name   string
	SHA256 [sha256.Size]byte
}

func (*DataFile) UUID

func (f *DataFile) UUID() uuid.UUID

type Module

type Module struct {
	Path    string
	Version string
}

func (*Module) String

func (m *Module) String() string

func (*Module) UUID

func (m *Module) UUID() uuid.UUID

type Package

type Package struct {
	Module       *Module
	RelativePath string
}

func (*Package) ImportPath

func (p *Package) ImportPath() string

func (*Package) UUID

func (p *Package) UUID() uuid.UUID

type Person

type Person struct {
	Name  string
	Email string
}

type Point

type Point struct {
	ResultUUID      uuid.UUID
	EnvironmentUUID uuid.UUID
	CommitSHA       string
	CommitTime      time.Time
	Value           float64
}

Point in a benchmark result timeseries.

type Points

type Points []*Point

Points is a series of measurements.

func (Points) Values

func (p Points) Values() []float64

Values returns the series of point values.

type Properties

type Properties map[string]string

func (Properties) UUID

func (p Properties) UUID() uuid.UUID

type Result

type Result struct {
	File        *DataFile
	Line        int
	Benchmark   *Benchmark
	Commit      *Commit
	Environment Properties
	Metadata    Properties
	Iterations  uint64
	Value       float64
}

func (*Result) UUID

func (r *Result) UUID() uuid.UUID

type Task

type Task struct {
	UUID             uuid.UUID
	Worker           string
	Spec             TaskSpec
	Status           TaskStatus
	LastStatusUpdate time.Time
	DatafileUUID     uuid.UUID
}

type TaskSpec

type TaskSpec struct {
	Type       TaskType
	TargetUUID uuid.UUID
	CommitSHA  string
}

TaskSpec specifies work required by a task.

type TaskStatus

type TaskStatus uint

TaskStatus describes the state of a task.

const (
	TaskStatusCreated             TaskStatus = iota + 1 // initial state
	TaskStatusInProgress                                // task has been sent to a worker and is in progress
	TaskStatusResultUploadStarted                       // result upload has begun
	TaskStatusResultUploaded                            // result upload complete
	TaskStatusCompleteSuccess                           // completed successfully
	TaskStatusCompleteError                             // completed with error
	TaskStatusHalted                                    // worker stopped processing the task
)

Supported task status values.

func TaskStatusCompleteValues

func TaskStatusCompleteValues() []TaskStatus

TaskStatusCompleteValues returns all complete task states.

func TaskStatusPendingValues

func TaskStatusPendingValues() []TaskStatus

TaskStatusPendingValues returns all pending task states.

func TaskStatusString

func TaskStatusString(s string) (TaskStatus, error)

TaskStatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func TaskStatusValues

func TaskStatusValues() []TaskStatus

TaskStatusValues returns all values of the enum

func (TaskStatus) IsATaskStatus

func (i TaskStatus) IsATaskStatus() bool

IsATaskStatus returns "true" if the value is listed in the enum definition. "false" otherwise

func (TaskStatus) IsComplete

func (s TaskStatus) IsComplete() bool

IsComplete reports whether this task is finished.

func (TaskStatus) IsPending

func (s TaskStatus) IsPending() bool

IsPending reports whether this task is in a pending state.

func (TaskStatus) String

func (i TaskStatus) String() string

type TaskType

type TaskType uint

TaskType describes a type of task.

const (
	TaskTypeModule TaskType = iota + 1 // benchmark a go module
)

Supported task types.

func TaskTypeString

func TaskTypeString(s string) (TaskType, error)

TaskTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func TaskTypeValues

func TaskTypeValues() []TaskType

TaskTypeValues returns all values of the enum

func (TaskType) IsATaskType

func (i TaskType) IsATaskType() bool

IsATaskType returns "true" if the value is listed in the enum definition. "false" otherwise

func (TaskType) String

func (i TaskType) String() string

Jump to

Keyboard shortcuts

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