tsplot

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

DO NOT EDIT Generated by codegen.go https://github.com/googleapis/go-genproto/blob/0135a39c27378c1b903c75204eff61a060be5eb7/googleapis/monitoring/v3/common.pb.go

Index

Constants

View Source
const DefaultQueryFilter = "resource.type = \"global\" AND metric.type = \"%s\""

DefaultQueryFilter the query filter used if no overrides are given.

Variables

View Source
var (
	DefaultColors_HighContrast = ColorPalette{
		Foreground: colornames.White,
		Background: colornames.Black,
		GridColor:  colornames.Darkgrey,
		LineColors: []color.Color{
			color.RGBA{
				R: 0xe6,
				G: 0x9f,
				B: 0x00,
				A: 0xff,
			},
			color.RGBA{
				R: 0x56,
				G: 0xb4,
				B: 0xe9,
				A: 0xff,
			},
			color.RGBA{
				R: 0x00,
				G: 0x9e,
				B: 0x73,
				A: 0xff,
			},
			color.RGBA{
				R: 0xf0,
				G: 0xe4,
				B: 0x42,
				A: 0xff,
			},
			color.RGBA{
				R: 0x00,
				G: 0x72,
				B: 0xb2,
				A: 0x00,
			},
			color.RGBA{
				R: 0xd5,
				G: 0x5e,
				B: 0x00,
				A: 0xff,
			},
			color.RGBA{
				R: 0xcc,
				G: 0x79,
				B: 0xa7,
				A: 0xff,
			},
		},
	}
)

Functions

func ApplyDefaultHighContrast

func ApplyDefaultHighContrast(p *plot.Plot)

ApplyDefaultHighContrast applies the default high contrast color scheme to the *plot.Plot.

Types

type ColorPalette

type ColorPalette struct {
	Foreground color.Color
	Background color.Color
	GridColor  color.Color
	LineColors []color.Color
}

type MetricQuery

type MetricQuery struct {
	Project          string
	MetricDescriptor string
	StartTime        *time.Time
	EndTime          *time.Time
	// contains filtered or unexported fields
}

MetricQuery is a type that encapsulates the various parts that are used to form a ListTimeSeriesRequest. If EndTime is not provided, it will be defaulted to the current time.

Required Fields: Project MetricDescriptor StartTime

func NewMetricQuery added in v0.0.4

func NewMetricQuery(project, metric string, startTime, endTime *time.Time) *MetricQuery

NewMetricQuery creates a new MetricQuery type with the aggregation opts initialized.

func (*MetricQuery) PerformWithClient

func (mq *MetricQuery) PerformWithClient(client *monitoring.MetricClient) (*monitoring.TimeSeriesIterator, error)

PerformWithClient sends the MetricQuery.ListTimeSeriesRequest to the Google Cloud Monitoring API. If the request has not been built yet, i.e: BuildRequest() has not been called on the MetricQuery, an error will be returned. A Google Cloud Monitoring client is required to be passed in as a parameter if authentication has not been set up on the client, an error will result from the call.

func (*MetricQuery) SetAlignmentPeriod added in v0.0.4

func (mq *MetricQuery) SetAlignmentPeriod(d time.Duration)

SetAlignmentPeriod sets the alignment duration.

func (*MetricQuery) SetQueryFilter

func (mq *MetricQuery) SetQueryFilter(queryFilter string)

SetQueryFilter provides a hook to modify the metric query filter.

func (*MetricQuery) Set_ALIGN_COUNT added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_COUNT()

func (*MetricQuery) Set_ALIGN_COUNT_FALSE added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_COUNT_FALSE()

func (*MetricQuery) Set_ALIGN_COUNT_TRUE added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_COUNT_TRUE()

func (*MetricQuery) Set_ALIGN_DELTA added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_DELTA()

func (*MetricQuery) Set_ALIGN_FRACTION_TRUE added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_FRACTION_TRUE()

func (*MetricQuery) Set_ALIGN_INTERPOLATE added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_INTERPOLATE()

func (*MetricQuery) Set_ALIGN_MAX added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_MAX()

func (*MetricQuery) Set_ALIGN_MEAN added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_MEAN()

func (*MetricQuery) Set_ALIGN_MIN added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_MIN()

func (*MetricQuery) Set_ALIGN_NEXT_OLDER added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_NEXT_OLDER()

func (*MetricQuery) Set_ALIGN_NONE added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_NONE()

func (*MetricQuery) Set_ALIGN_PERCENTILE_05 added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_PERCENTILE_05()

func (*MetricQuery) Set_ALIGN_PERCENTILE_50 added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_PERCENTILE_50()

func (*MetricQuery) Set_ALIGN_PERCENTILE_95 added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_PERCENTILE_95()

func (*MetricQuery) Set_ALIGN_PERCENTILE_99 added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_PERCENTILE_99()

func (*MetricQuery) Set_ALIGN_PERCENT_CHANGE added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_PERCENT_CHANGE()

func (*MetricQuery) Set_ALIGN_RATE added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_RATE()

func (*MetricQuery) Set_ALIGN_STDDEV added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_STDDEV()

func (*MetricQuery) Set_ALIGN_SUM added in v0.0.4

func (mq *MetricQuery) Set_ALIGN_SUM()

func (*MetricQuery) Set_REDUCE_COUNT added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_COUNT()

func (*MetricQuery) Set_REDUCE_COUNT_FALSE added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_COUNT_FALSE()

func (*MetricQuery) Set_REDUCE_COUNT_TRUE added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_COUNT_TRUE()

func (*MetricQuery) Set_REDUCE_FRACTION_TRUE added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_FRACTION_TRUE()

func (*MetricQuery) Set_REDUCE_MAX added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_MAX()

func (*MetricQuery) Set_REDUCE_MEAN added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_MEAN()

func (*MetricQuery) Set_REDUCE_MIN added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_MIN()

func (*MetricQuery) Set_REDUCE_NONE added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_NONE()

func (*MetricQuery) Set_REDUCE_PERCENTILE_05 added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_PERCENTILE_05()

func (*MetricQuery) Set_REDUCE_PERCENTILE_50 added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_PERCENTILE_50()

func (*MetricQuery) Set_REDUCE_PERCENTILE_95 added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_PERCENTILE_95()

func (*MetricQuery) Set_REDUCE_PERCENTILE_99 added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_PERCENTILE_99()

func (*MetricQuery) Set_REDUCE_STDDEV added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_STDDEV()

func (*MetricQuery) Set_REDUCE_SUM added in v0.0.4

func (mq *MetricQuery) Set_REDUCE_SUM()

type PlotOption

type PlotOption func(p *plot.Plot)

PlotOption defines the type used to configure the underlying *plot.Plot. A function that returns PlotOption can be used to set options on the *plot.Plot.

func WithBackground

func WithBackground(color color.Color) PlotOption

WithBackground sets the background color on the *plot.Plot.

func WithForeground

func WithForeground(color color.Color) PlotOption

WithForeground sets the foreground colors of the *plot.Plot to the provided color.

func WithGrid

func WithGrid(color color.Color) PlotOption

WithGrid adds a grid to the *plot.Plot and sets the color.

func WithLegend

func WithLegend(color color.Color) PlotOption

WithLegend sets the text color of the legend.

func WithTitle

func WithTitle(title string) PlotOption

WithTitle configures the title text of the *plot.Plot.

func WithXAxisName

func WithXAxisName(name string) PlotOption

WithXAxisName sets the name of the X Axis.

func WithXTimeTicks

func WithXTimeTicks(format string) PlotOption

WithXTimeTicks configures the format for the tick marks on the X Axis.

func WithYAxisName

func WithYAxisName(name string) PlotOption

WithYAxisName sets the name of the Y Axis.

type TimeSeries

type TimeSeries map[string][]*monitoringpb.Point

TimeSeries is a map representation of unique names to time series.

func (TimeSeries) Plot

func (ts TimeSeries) Plot(opts ...PlotOption) (*plot.Plot, error)

Plot builds and returns a *plot.Plot. If the TimeSeriesGroup field in TimeSeriesPlot is empty, a nil plot is returned as well as an error. This is also the case if an error is encountered building the line from the XY coordinates.

Jump to

Keyboard shortcuts

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