perfdata
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package perfdata contains a client for the performance data storage server.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeClient¶
type Client struct {// BaseURL is the base URL of the storage server.BaseURLstring// HTTPClient is the HTTP client for sending requests. If nil, http.DefaultClient will be used.HTTPClient *http.Client}A Client issues queries to a performance data storage server.It is safe to use from multiple goroutines simultaneously.
func (*Client)ListUploads¶
func (c *Client) ListUploads(ctxcontext.Context, qstring, extraLabels []string, limitint) *UploadList
ListUploads searches for uploads containing results matching the given query string.The query may be empty, in which case all uploads will be returned.extraLabels specifies other labels to be retrieved.If limit is 0, no limit will be provided to the server.The uploads are returned starting with the most recent upload.
func (*Client)NewUpload¶
NewUpload starts a new upload to the storage server.The upload must have Abort or Commit called on it.If the server requires authentication for uploads, c.HTTPClient should be set to the result of oauth2.NewClient.
func (*Client)Query¶
Query searches for results matching the given query string. Theresult is a stream of bytes containing text benchmark data. This datamay be parsed and processed by the x/perf/benchfmt package.
The query string is first parsed into quoted words (as in the shell)and then each word must be formatted as one of the following:key:value - exact match on label "key" = "value"key>value - value greater than (useful for dates)key<value - value less than (also useful for dates)
typeUpload¶
type Upload struct {// contains filtered or unexported fields}An Upload is an in-progress upload.Use CreateFile to upload one or more files, then call Commit or Abort.
u := client.NewUpload()w, err := u.CreateFile()if err != nil { u.Abort() return err}fmt.Fprintf(w, "BenchmarkResult 1 1 ns/op\n")if err := u.Commit(); err != nil { return err}func (*Upload)Commit¶
func (u *Upload) Commit() (*UploadStatus,error)
Commit attempts to commit the upload.
typeUploadInfo¶
UploadInfo represents an upload summary.
typeUploadList¶
type UploadList struct {// contains filtered or unexported fields}UploadList is the result of ListUploads.Use Next to advance through the rows, making sure to call Close when done:
q := db.ListUploads("key:value")defer q.Close()for q.Next() { id, count := q.Row() labels := q.LabelValues() ...}err = q.Err() // get any error encountered during iteration...func (*UploadList)Close¶
func (ul *UploadList) Close()error
Close frees resources associated with the query.
func (*UploadList)Info¶
func (ul *UploadList) Info()UploadInfo
Info returns the most recent UploadInfo generated by a call to Next.
func (*UploadList)Next¶
func (ul *UploadList) Next()bool
Next prepares the next result for reading with the Resultmethod. It returns false when there are no more results, either byreaching the end of the input or an error.
typeUploadStatus¶
type UploadStatus struct {// UploadID is the upload ID assigned to the upload.UploadIDstring `json:"uploadid"`// FileIDs is the list of file IDs assigned to the files in the upload.FileIDs []string `json:"fileids"`// ViewURL is a server-supplied URL to view the results.ViewURLstring `json:"viewurl"`}UploadStatus contains information about a successful upload.
Directories¶
| Path | Synopsis |
|---|---|
Package app implements the performance data storage server. | Package app implements the performance data storage server. |
This binary contains an App Engine app for perfdata.golang.org | This binary contains an App Engine app for perfdata.golang.org |
Package db provides the high-level database interface for the storage app. | Package db provides the high-level database interface for the storage app. |
sqlite3 Package sqlite3 provides the sqlite3 driver for x/build/perfdata/db. | Package sqlite3 provides the sqlite3 driver for x/build/perfdata/db. |
Package fs provides a backend-agnostic filesystem layer for storing performance results. | Package fs provides a backend-agnostic filesystem layer for storing performance results. |
gcs Package gcs implements the fs.FS interface using Google Cloud Storage. | Package gcs implements the fs.FS interface using Google Cloud Storage. |
local Package local implements the fs.FS interface using local files. | Package local implements the fs.FS interface using local files. |
Localperfdata runs an HTTP server for benchmark perfdata. | Localperfdata runs an HTTP server for benchmark perfdata. |
Package query provides tools for parsing a query. | Package query provides tools for parsing a query. |