frame

package
v0.0.0-...-71cd2e8 Latest Latest
Warning

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

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

Documentation

Overview

Package frame takes frontend requests for dataframes (FrameRequest), and turns them into FrameResponses.

Index

Constants

This section is empty.

Variables

AllRequestType is all possible values for a RequestType variable.

AllResponseDisplayModes lists all ResponseDisplayMode for use by go2ts.

Functions

func ProcessFrameRequest

func ProcessFrameRequest(ctx context.Context, req *FrameRequest, perfGit perfgit.Git, dfBuilder dataframe.DataFrameBuilder, shortcutStore shortcut.Store, anomalyStore anomalies.Store, searchAnomaliesTimeBased bool) error

ProcessFrameRequest starts processing a FrameRequest.

It does not return until all the work is complete.

The finished results are stored in the FrameRequestProcess.Progress.Results.

Types

type FrameRequest

type FrameRequest 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.
	Formulas    []string    `json:"formulas"`    // The Formulae to evaluate.
	Queries     []string    `json:"queries"`     // The queries to perform encoded as a URL query.
	Keys        string      `json:"keys"`        // The id of a list of keys stored via shortcut2.
	TZ          string      `json:"tz"`          // The timezone the request is from. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/resolvedOptions
	NumCommits  int32       `json:"num_commits"` // If RequestType is REQUEST_COMPACT, then the number of commits to show before End, and Begin is ignored.
	RequestType RequestType `json:"request_type"`

	Pivot *pivot.Request `json:"pivot"`

	Progress progress.Progress `json:"-"`
}

FrameRequest is used to deserialize JSON frame requests.

func NewFrameRequest

func NewFrameRequest() *FrameRequest

NewFrameRequest returns a new FrameRequest instance.

type FrameResponse

type FrameResponse struct {
	DataFrame   *dataframe.DataFrame  `json:"dataframe"`
	Skps        []int                 `json:"skps"`
	Msg         string                `json:"msg"`
	DisplayMode ResponseDisplayMode   `json:"display_mode"`
	AnomalyMap  chromeperf.AnomalyMap `json:"anomalymap"`
}

FrameResponse is serialized to JSON as the response to frame requests.

func ResponseFromDataFrame

func ResponseFromDataFrame(ctx context.Context, pivotRequest *pivot.Request, df *dataframe.DataFrame, perfGit perfgit.Git, truncate bool, progress progress.Progress) (*FrameResponse, error)

ResponseFromDataFrame fills out the rest of a FrameResponse for the given DataFrame.

If truncate is true then the number of traces returned is limited.

tz is the timezone, and can be the empty string if the default (Eastern) timezone is acceptable.

type RequestType

type RequestType int

RequestType distinguishes the domain of the traces returned in a FrameResponse.

const (
	// Values for FrameRequest.RequestType.
	REQUEST_TIME_RANGE RequestType = 0
	REQUEST_COMPACT    RequestType = 1

	DEFAULT_COMPACT_NUM_COMMITS = 200
)

type ResponseDisplayMode

type ResponseDisplayMode string

ResponseDisplayMode are the different modes of the explore-sk page.

const (
	// DisplayQueryOnly means just display the Query button.
	DisplayQueryOnly ResponseDisplayMode = "display_query_only"

	// DisplayPlot display the results of a query as a plot.
	DisplayPlot ResponseDisplayMode = "display_plot"

	// DisplayPivotTable display the results of a query as a pivot table.
	DisplayPivotTable ResponseDisplayMode = "display_pivot_table"

	// DisplayPivotPlot display the results of a query as a plot of pivoted traces.
	DisplayPivotPlot ResponseDisplayMode = "display_pivot_plot"

	// DisplaySpinner display the spinner indicating we are waiting for results.
	DisplaySpinner ResponseDisplayMode = "display_spinner"
)

Jump to

Keyboard shortcuts

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