Documentation ¶
Overview ¶
Package sheets provides a metrics provider implementation that retrieves metrics from a publicly-available Google Sheets
The document must have the following values, starting at row 2, in the following order.
Region, Service, Request Count, Error Rate, Latency P99, Latency P95, Latency P50 ¶
Example us-east1, tester, 1000, 0.01, 1000, 750, 500
Index ¶
- type Provider
- func (p *Provider) ErrorRate(ctx context.Context, offset time.Duration) (float64, error)
- func (p *Provider) Latency(ctx context.Context, offset time.Duration, alignReduceType metrics.AlignReduce) (float64, error)
- func (p *Provider) RequestCount(ctx context.Context, offset time.Duration) (int64, error)
- func (p *Provider) SetCandidateRevision(revisionName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a metrics provider for Google Sheets.
func NewProvider ¶
func NewProvider(ctx context.Context, sheetsID, sheetName, region, serviceName string) (*Provider, error)
NewProvider initializes a connection to Google Sheets
func (*Provider) ErrorRate ¶
ErrorRate returns the rate of 5xx errors for the resource matching the filter.
func (*Provider) Latency ¶
func (p *Provider) Latency(ctx context.Context, offset time.Duration, alignReduceType metrics.AlignReduce) (float64, error)
Latency returns the latency for the resource for the given offset.
func (*Provider) RequestCount ¶
RequestCount returns the number of requests for the given offset.
func (*Provider) SetCandidateRevision ¶
SetCandidateRevision sets the candidate revision name for which the provider should get metrics.
For Google Sheets, ignore this since the data in the document is always for the candidate revision.