poprepo

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: 12 Imported by: 1

Documentation

Overview

poprepo is a package for populating a git repo with commits that associate a git commit with a buildid, a monotonically increasing number maintained by a external build system. This is needed because Perf only knows how to associate measurement values with git commits.

Index

Constants

View Source
const (
	BUILDID_FILENAME = "BUILDID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PopRepo

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

PopRepo implements PopRepoI.

func NewPopRepo

func NewPopRepo(checkout git.Checkout, local bool, subdomain string) *PopRepo

NewPopRepo returns a *PopRepo that writes and reads BuildIds into the 'checkout'.

If not 'local' then the HOME environment variable is set for running on the server.

func (*PopRepo) Add

func (p *PopRepo) Add(ctx context.Context, buildid int64, ts int64) error

Add a new buildid and its assocatied Unix timestamp to the repo.

func (*PopRepo) GetLast

func (p *PopRepo) GetLast(ctx context.Context) (int64, int64, string, error)

GetLast returns the last buildid, the timestamp of when that buildid was added, and the git hash.

The timestamp is seconds since the Unix epoch.

func (*PopRepo) LookupBuildID

func (p *PopRepo) LookupBuildID(ctx context.Context, hash string) (int64, error)

See PopRepoI.

type PopRepoI

type PopRepoI interface {
	// GetLast returns the last committed buildid, its timestamp, and git hash.
	GetLast(ctx context.Context) (int64, int64, string, error)

	// Add a new buildid to the repo.
	Add(ctx context.Context, buildid, ts int64) error

	// LookupBuildID looks up a buildid and branch from the git hash.
	LookupBuildID(ctx context.Context, hash string) (int64, error)
}

PopRepoI is the interface that PopRepo supports.

It supports adding and reading BuildIDs from a git repo.

Jump to

Keyboard shortcuts

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