Documentation ¶
Index ¶
- type Option
- func ColorBackground() Option
- func ColorValue() Option
- func Colors(values [3]string) Option
- func DataSource(source string) Option
- func Decimals(count int) Option
- func Description(content string) Option
- func FullSparkLine() Option
- func Height(height string) Option
- func Links(panelLinks ...links.Link) Option
- func Postfix(postfix string) Option
- func PostfixFontSize(size string) Option
- func Prefix(prefix string) Option
- func PrefixFontSize(size string) Option
- func RangesToText(mapping []RangeMap) Option
- func Repeat(repeat string) Option
- func RepeatDirection(direction sdk.RepeatDirection) Option
- func Span(span float32) Option
- func SparkLine() Option
- func SparkLineColor(color string) Option
- func SparkLineFillColor(color string) Option
- func SparkLineYMax(value float64) Option
- func SparkLineYMin(value float64) Option
- func Thresholds(values [2]string) Option
- func Transparent() Option
- func Unit(unit string) Option
- func ValueFontSize(size string) Option
- func ValueType(valueType StatType) Option
- func ValuesToText(mapping []ValueMap) Option
- func WithGraphiteTarget(query string, options ...graphite.Option) Option
- func WithInfluxDBTarget(query string, options ...influxdb.Option) Option
- func WithPrometheusTarget(query string, options ...prometheus.Option) Option
- func WithStackdriverTarget(target *stackdriver.Stackdriver) Option
- type RangeMap
- type SingleStat
- type StatType
- type ValueMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(stat *SingleStat) error
Option represents an option that can be used to configure a single stat panel.
func ColorBackground ¶
func ColorBackground() Option
ColorBackground will show the threshold's colors in the background.
func ColorValue ¶
func ColorValue() Option
ColorValue will show the threshold's colors on the value itself.
func Colors ¶
Colors define which colors will be applied to the single value based on the threshold levels.
func DataSource ¶
DataSource sets the data source to be used by the panel.
func Description ¶
Description annotates the current visualization with a human-readable description.
func FullSparkLine ¶
func FullSparkLine() Option
FullSparkLine displays a full height spark line summary of the series in addition to the single stat.
func PostfixFontSize ¶
PostfixFontSize sets the size used for the postfix text (eg: "110%")
func PrefixFontSize ¶
PrefixFontSize sets the size used for the prefix text (eg: "110%").
func RangesToText ¶
RangesToText allows to translate the value of the summary stat into explicit text.
func RepeatDirection ¶
func RepeatDirection(direction sdk.RepeatDirection) Option
RepeatDirection configures repeating vertical or horizontal
func Span ¶
Span sets the width of the panel, in grid units. Should be a positive number between 1 and 12. Example: 6.
func SparkLine ¶
func SparkLine() Option
SparkLine displays the spark line summary of the series in addition to the single stat.
func SparkLineColor ¶
SparkLineColor sets the line color of the spark line.
func SparkLineFillColor ¶
SparkLineFillColor sets the color the spark line will be filled with.
func SparkLineYMax ¶
SparkLineYMax defines the largest value expected on the Y axis of the spark line.
func SparkLineYMin ¶
SparkLineYMin defines the smallest value expected on the Y axis of the spark line.
func Thresholds ¶
Thresholds change the background and value colors dynamically within the panel, depending on the Singlestat value. The threshold is defined by 2 values which represent 3 ranges that correspond to the three colors directly to the right.
func ValueFontSize ¶
ValueFontSize sets the font size used to display the value (eg: "100%").
func ValuesToText ¶
ValuesToText allows to translate the value of the summary stat into explicit text.
func WithGraphiteTarget ¶
WithGraphiteTarget adds a Graphite target to the graph.
func WithInfluxDBTarget ¶
WithInfluxDBTarget adds an InfluxDB target to the graph.
func WithPrometheusTarget ¶
func WithPrometheusTarget(query string, options ...prometheus.Option) Option
WithPrometheusTarget adds a prometheus query to the graph.
func WithStackdriverTarget ¶
func WithStackdriverTarget(target *stackdriver.Stackdriver) Option
WithStackdriverTarget adds a stackdriver query to the graph.
type SingleStat ¶
SingleStat represents a single stat panel.
type StatType ¶
type StatType string
StatType let you set the function that your entire query is reduced into a single value with.
const ( // Min will return the smallest value in the series. Min StatType = "min" // Max will return the largest value in the series. Max StatType = "max" // Avg will return the average of all the non-null values in the series. Avg StatType = "avg" // Current will return the last value in the series. If the series ends on // null the previous value will be used. Current StatType = "current" // Total will return the sum of all the non-null values in the series. Total StatType = "total" // First will return the first value in the series. First StatType = "first" // Delta will return the total incremental increase (of a counter) in the // series. An attempt is made to account for counter resets, but this will // only be accurate for single instance metrics. Used to show total // counter increase in time series. Delta StatType = "delta" // Diff will return difference between ‘current’ (last value) and ‘first’.. Diff StatType = "diff" // Range will return the difference between ‘min’ and ‘max’. Useful to // show the range of change for a gauge.. Range StatType = "range" // Name will return the name value in the series. Name StatType = "name" )