Documentation
¶
Index ¶
- type Measurements
- func (m *Measurements) AddToGauge(name string, f float64) bool
- func (m *Measurements) CreateUpdateObservableGauge(name, description string)
- func (m *Measurements) CreateUpdateObservableHistogram(name, description string)
- func (m *Measurements) DecrementGauge(name string) bool
- func (m *Measurements) IncrementGauge(name string) bool
- func (m *Measurements) RecordHistogramTime(name string, t time.Duration) bool
- func (m *Measurements) RecordHistogramValue(name string, f float64) bool
- func (m *Measurements) RemoveFromGauge(name string, f float64) bool
- func (m *Measurements) SetGauge(name string, f float64) bool
- func (m *Measurements) SetToCurrentTimeGauge(name string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Measurements ¶
type Measurements struct {
// contains filtered or unexported fields
}
Measurements collects measurements for prometheus.
func Run ¶
func Run(ctx context.Context, cancel context.CancelFunc, port int) (*Measurements, error)
Run starts collecting metrics and server with prometheus telemetry endpoint. Returns Measurements structure if successfully started or cancels context otherwise. Default port of 2112 is used if port value is set to 0.
func (*Measurements) AddToGauge ¶
func (m *Measurements) AddToGauge(name string, f float64) bool
AddToGauge adds to gauge the value if entity with given name exists.
func (*Measurements) CreateUpdateObservableGauge ¶
func (m *Measurements) CreateUpdateObservableGauge(name, description string)
CreateUpdateObservableGauge creats or updates observable gauge.
func (*Measurements) CreateUpdateObservableHistogram ¶
func (m *Measurements) CreateUpdateObservableHistogram(name, description string)
CreateUpdateObservableHistogram creates or updates observable histogram.
func (*Measurements) DecrementGauge ¶
func (m *Measurements) DecrementGauge(name string) bool
DecrementGauge decrements gauge the value if entity with given name exists.
func (*Measurements) IncrementGauge ¶
func (m *Measurements) IncrementGauge(name string) bool
IncrementGauge increments gauge the value if entity with given name exists.
func (*Measurements) RecordHistogramTime ¶
func (m *Measurements) RecordHistogramTime(name string, t time.Duration) bool
RecordHistogramTime records histogram time if entity with given name exists.
func (*Measurements) RecordHistogramValue ¶
func (m *Measurements) RecordHistogramValue(name string, f float64) bool
RecordHistogramValue records histogram value if entity with given name exists.
func (*Measurements) RemoveFromGauge ¶
func (m *Measurements) RemoveFromGauge(name string, f float64) bool
RemoveFromGauge removes from gauge the value if entity with given name exists.
func (*Measurements) SetGauge ¶
func (m *Measurements) SetGauge(name string, f float64) bool
SetGauge sets the gauge to the value if entity with given name exists.
func (*Measurements) SetToCurrentTimeGauge ¶
func (m *Measurements) SetToCurrentTimeGauge(name string) bool
SetToCurrentTimeGauge sets the gauge to the current time if entity with given name exists.