dryrun

package
v0.0.0-...-03d6fc4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

dryrun allows testing an Alert and seeing the regression it would find.

Index

Constants

View Source
const (
	CLEANUP_DURATION = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	Begin       int                   `json:"begin"`       // Beginning of time range in Unix timestamp seconds.
	End         int                   `json:"end"`         // End of time range in Unix timestamp seconds.
	NumCommits  int32                 `json:"num_commits"` // If RequestType is REQUEST_COMPACT, then the number of commits to show before End, and Begin is ignored.
	RequestType dataframe.RequestType `json:"request_type"`
}

Domain is the time domain over which to look for commit.

Generated by the <domain-picker-sk> element.

type RegressionRow

type RegressionRow struct {
	CID        *cid.CommitDetail      `json:"cid"`
	Regression *regression.Regression `json:"regression"`
}

RegressionRow is a Regression found for a specific commit.

type Requests

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

Requests handles HTTP request for doing dryruns.

func New

func New(cidl *cid.CommitIDLookup, dfBuilder dataframe.DataFrameBuilder, paramsProvider regression.ParamsetProvider, git *gitinfo.GitInfo) *Requests

func (*Requests) StartHandler

func (d *Requests) StartHandler(w http.ResponseWriter, r *http.Request)

func (*Requests) StatusHandler

func (d *Requests) StatusHandler(w http.ResponseWriter, r *http.Request)

type Running

type Running struct {
	Finished    bool                              `json:"finished"`    // True if the dry run is complete.
	Message     string                            `json:"message"`     // Human readable string describing the dry run state.
	Regressions map[string]*regression.Regression `json:"regressions"` // All the regressions found so far.
	// contains filtered or unexported fields
}

Running is the data stored for each running dryrun.

type StartRequest

type StartRequest struct {
	Config alerts.Config `json:"config"`
	Domain Domain        `json:"domain"`
}

StartRequest is the data POSTed to StartHandler.

func (*StartRequest) Id

func (s *StartRequest) Id() string

Id is used to identify StartRequests as stored in Requests.inFlight.

type StartResponse

type StartResponse struct {
	ID string `json:"id"`
}

StartResponse is the JSON response sent from StartHandler.

type Status

type Status struct {
	Finished    bool             `json:"finished"`
	Message     string           `json:"message"`
	Regressions []*RegressionRow `json:"regressions"`
}

Status is the JSON response sent from StatusHandler.

Jump to

Keyboard shortcuts

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