Documentation
¶
Index ¶
- Variables
- type Builder
- func (b *Builder) GetOrCreateCounter() *metrics.Counter
- func (b *Builder) GetOrCreateCounterInSet(set *metrics.Set) *metrics.Counter
- func (b *Builder) GetOrCreateFloatCounter() *metrics.FloatCounter
- func (b *Builder) GetOrCreateFloatCounterInSet(set *metrics.Set) *metrics.FloatCounter
- func (b *Builder) GetOrCreateGauge(f func() float64) *metrics.Gauge
- func (b *Builder) GetOrCreateGaugeInSet(set *metrics.Set, f func() float64) *metrics.Gauge
- func (b *Builder) GetOrCreateHistogram() *metrics.Histogram
- func (b *Builder) GetOrCreateHistogramInSet(set *metrics.Set) *metrics.Histogram
- func (b *Builder) GetOrCreateSummary() *metrics.Summary
- func (b *Builder) GetOrCreateSummaryExt(window time.Duration, quantiles []float64) *metrics.Summary
- func (b *Builder) GetOrCreateSummaryExtInSet(set *metrics.Set, window time.Duration, quantiles []float64) *metrics.Summary
- func (b *Builder) GetOrCreateSummaryInSet(set *metrics.Set) *metrics.Summary
- func (b *Builder) Label(name, value string) *Builder
- func (b *Builder) LabelBool(name string, value bool) *Builder
- func (b *Builder) LabelErr(name string, err error) *Builder
- func (b *Builder) LabelErrQuote(name string, err error) *Builder
- func (b *Builder) LabelFloat32(name string, value float32) *Builder
- func (b *Builder) LabelFloat64(name string, value float64) *Builder
- func (b *Builder) LabelInt(name string, value int) *Builder
- func (b *Builder) LabelInt8(name string, value int8) *Builder
- func (b *Builder) LabelInt16(name string, value int16) *Builder
- func (b *Builder) LabelInt32(name string, value int32) *Builder
- func (b *Builder) LabelInt64(name string, value int64) *Builder
- func (b *Builder) LabelQuote(name, value string) *Builder
- func (b *Builder) LabelStringer(name string, value fmt.Stringer) *Builder
- func (b *Builder) LabelStringerQuote(name string, value fmt.Stringer) *Builder
- func (b *Builder) LabelUint(name string, value uint) *Builder
- func (b *Builder) LabelUint8(name string, value uint8) *Builder
- func (b *Builder) LabelUint16(name string, value uint16) *Builder
- func (b *Builder) LabelUint32(name string, value uint32) *Builder
- func (b *Builder) LabelUint64(name string, value uint64) *Builder
- func (b *Builder) Metric(name string) *Builder
- func (b *Builder) NewCounter() *metrics.Counter
- func (b *Builder) NewCounterInSet(set *metrics.Set) *metrics.Counter
- func (b *Builder) NewFloatCounter() *metrics.FloatCounter
- func (b *Builder) NewFloatCounterInSet(set *metrics.Set) *metrics.FloatCounter
- func (b *Builder) NewGauge(f func() float64) *metrics.Gauge
- func (b *Builder) NewGaugeInSet(set *metrics.Set, f func() float64) *metrics.Gauge
- func (b *Builder) NewHistogram() *metrics.Histogram
- func (b *Builder) NewHistogramInSet(set *metrics.Set) *metrics.Histogram
- func (b *Builder) NewSummary() *metrics.Summary
- func (b *Builder) NewSummaryExt(window time.Duration, quantiles []float64) *metrics.Summary
- func (b *Builder) NewSummaryExtInSet(set *metrics.Set, window time.Duration, quantiles []float64) *metrics.Summary
- func (b *Builder) NewSummaryInSet(set *metrics.Set) *metrics.Summary
- func (b *Builder) String() string
Constants ¶
This section is empty.
Variables ¶
var ( MetricNameMaxLen = 256 // MetricNameMaxLen is the maximum len in bytes allowed for the metric name. LabelNameMaxLen = 128 // LabelNameMaxLen is the maximum len in bytes allowed for a label name. LabelValueLen = 1024 // LabelValueLen is the maximum len in bytes allowed for a label value. )
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is used to efficiently build a VictoriaMetrics metric. It's backed by a bytes.Buffer to minimize memory copying.
The zero value is ready to use.
func Metric ¶
Metric creates a new Builder. It can be useful if you want to create a metric in a single line.
func (*Builder) GetOrCreateCounter ¶ added in v1.0.0
GetOrCreateCounter calls metrics.GetOrCreateCounter using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateCounterInSet ¶ added in v1.1.0
GetOrCreateCounterInSet calls metrics.Set.GetOrCreateCounter using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateFloatCounter ¶ added in v1.0.0
func (b *Builder) GetOrCreateFloatCounter() *metrics.FloatCounter
GetOrCreateFloatCounter calls metrics.GetOrCreateFloatCounter using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateFloatCounterInSet ¶ added in v1.1.0
func (b *Builder) GetOrCreateFloatCounterInSet(set *metrics.Set) *metrics.FloatCounter
GetOrCreateFloatCounterInSet calls metrics.Set.GetOrCreateFloatCounter using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateGauge ¶ added in v1.0.0
GetOrCreateGauge calls metrics.GetOrCreateGauge using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateGaugeInSet ¶ added in v1.1.0
GetOrCreateGaugeInSet calls metrics.Set.GetOrCreateGauge using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateHistogram ¶ added in v1.0.0
GetOrCreateHistogram calls metrics.GetOrCreateHistogram using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateHistogramInSet ¶ added in v1.1.0
GetOrCreateHistogramInSet calls metrics.Set.GetOrCreateHistogram using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateSummary ¶ added in v1.0.0
GetOrCreateSummary calls metrics.GetOrCreateSummary using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateSummaryExt ¶ added in v1.0.0
GetOrCreateSummaryExt calls metrics.GetOrCreateSummaryExt using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateSummaryExtInSet ¶ added in v1.1.0
func (b *Builder) GetOrCreateSummaryExtInSet(set *metrics.Set, window time.Duration, quantiles []float64) *metrics.Summary
GetOrCreateSummaryExtInSet calls metrics.Set.GetOrCreateSummaryExt using the Builder's accumulated string as argument.
func (*Builder) GetOrCreateSummaryInSet ¶ added in v1.1.0
GetOrCreateSummaryInSet calls metrics.Set.GetOrCreateSummary using the Builder's accumulated string as argument.
func (*Builder) Label ¶
Label appends a pair of label name and label value to the Builder. Unlike vimebu.Builder.LabelQuote, quotes inside the label value will not be escaped. It's better suited for a label value where you control the input (either it is already sanitized, or it comes from a const or an enum for example).
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
- the label value is empty or contains more than vimebu.LabelValueMaxLen.
func (*Builder) LabelBool ¶ added in v1.0.0
LabelBool appends a pair of label name and boolean label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelErr ¶ added in v1.4.0
LabelErr appends a pair of label name and error label value to the Builder. Unlike vimebu.Builder.LabelErrQuote, quotes inside the error label value will not be escaped. It's better suited for a label value where you control the input (either it is already sanitized, or it comes from a const or an enum for example).
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
- the label value is empty or contains more than vimebu.LabelValueMaxLen.
func (*Builder) LabelErrQuote ¶ added in v1.4.0
LabelErrQuote appends a pair of label name and error label value to the Builder. Quotes inside the error label value will be escaped.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
- the label value is empty or contains more than vimebu.LabelValueMaxLen.
func (*Builder) LabelFloat32 ¶ added in v1.3.1
LabelFloat32 appends a pair of label name and float32 label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelFloat64 ¶ added in v1.3.1
LabelFloat64 appends a pair of label name and float64 label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelInt ¶ added in v1.0.0
LabelInt appends a pair of label name and int label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelInt8 ¶ added in v1.3.1
LabelInt8 appends a pair of label name and int8 label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelInt16 ¶ added in v1.3.1
LabelInt16 appends a pair of label name and int16 label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelInt32 ¶ added in v1.3.1
LabelInt32 appends a pair of label name and int32 label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelInt64 ¶ added in v1.3.1
LabelInt64 appends a pair of label name and int64 label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelQuote ¶ added in v0.5.0
LabelQuote appends a pair of label name and label value to the Builder. Quotes inside the label value will be escaped.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
- the label value is empty or contains more than vimebu.LabelValueMaxLen.
func (*Builder) LabelStringer ¶ added in v1.0.1
LabelStringer appends a pair of label name and label value (implementing fmt.Stringer) to the Builder. Unlike vimebu.Builder.LabelStringerQuote, quotes inside the label value will not be escaped. It's better suited for a label value where you control the input (either it is already sanitized, or it comes from a const or an enum for example).
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelStringerQuote ¶ added in v1.0.1
LabelStringerQuote appends a pair of label name and label value (implementing fmt.Stringer) to the Builder. Quotes inside the label value will be escaped.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelUint ¶ added in v1.3.1
LabelUint appends a pair of label name and uint label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelUint8 ¶ added in v1.3.1
LabelUint8 appends a pair of label name and uint8 label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelUint16 ¶ added in v1.3.1
LabelUint16 appends a pair of label name and uint16 label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelUint32 ¶ added in v1.3.1
LabelUint32 appends a pair of label name and uint32 label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) LabelUint64 ¶ added in v1.3.1
LabelUint64 appends a pair of label name and uint64 label value to the Builder.
NoOp if :
- no metric name has been set using vimebu.Builder.Metric.
- the label name is empty or contains more than vimebu.LabelNameMaxLen.
func (*Builder) Metric ¶
Metric sets the metric name of the Builder.
NoOp if :
- called more than once for the same builder instance.
- the name is empty or contains more than vimebu.MetricNameMaxLen bytes.
- the name contains a double quote.
func (*Builder) NewCounter ¶ added in v1.0.0
NewCounter calls metrics.NewCounter using the Builder's accumulated string as argument.
func (*Builder) NewCounterInSet ¶ added in v1.1.0
NewCounterInSet calls metrics.Set.NewCounter using the Builder's accumulated string as argument.
func (*Builder) NewFloatCounter ¶ added in v1.0.0
func (b *Builder) NewFloatCounter() *metrics.FloatCounter
NewFloatCounter calls metrics.NewFloatCounter using the Builder's accumulated string as argument.
func (*Builder) NewFloatCounterInSet ¶ added in v1.1.0
func (b *Builder) NewFloatCounterInSet(set *metrics.Set) *metrics.FloatCounter
NewFloatCounterInSet calls metrics.Set.NewFloatCounter using the Builder's accumulated string as argument.
func (*Builder) NewGauge ¶ added in v1.0.0
NewGauge calls metrics.NewGauge using the Builder's accumulated string as argument.
func (*Builder) NewGaugeInSet ¶ added in v1.1.0
NewGaugeInSet calls metrics.Set.NewGauge using the Builder's accumulated string as argument.
func (*Builder) NewHistogram ¶ added in v1.0.0
NewHistogram calls metrics.NewHistogram using the Builder's accumulated string as argument.
func (*Builder) NewHistogramInSet ¶ added in v1.1.0
NewHistogramInSet calls metrics.Set.NewHistogram using the Builder's accumulated string as argument.
func (*Builder) NewSummary ¶ added in v1.0.0
NewSummary calls metrics.NewSummary using the Builder's accumulated string as argument.
func (*Builder) NewSummaryExt ¶ added in v1.0.0
NewSummaryExt calls metrics.NewSummaryExt using the Builder's accumulated string as argument.
func (*Builder) NewSummaryExtInSet ¶ added in v1.1.0
func (b *Builder) NewSummaryExtInSet(set *metrics.Set, window time.Duration, quantiles []float64) *metrics.Summary
NewSummaryExtInSet calls metrics.Set.NewSummaryExtInSet using the Builder's accumulated string as argument.
func (*Builder) NewSummaryInSet ¶ added in v1.1.0
NewSummaryInSet calls metrics.Set.NewSummary using the Builder's accumulated string as argument.