publisher

package
v0.0.0-...-42600ef Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2017 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package publisher implements github.com/the-anna-project/instrumentor.Publisher and provides instrumentation primitives to emit application metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Counter

type Counter struct {
}

func NewCounter

func NewCounter(config spec.CounterConfig) (*Counter, error)

NewCounter creates a new configured prometheus publisher counter object.

func (*Counter) Increment

func (c *Counter) Increment(delta float64) error

func (*Counter) IncrementWithLabels

func (c *Counter) IncrementWithLabels(delta float64, values ...string) error

type CounterConfig

type CounterConfig struct {
	// contains filtered or unexported fields
}

CounterConfig represents the configuration used to create a new memory publisher counter object.

func DefaultCounterConfig

func DefaultCounterConfig() *CounterConfig

DefaultCounterConfig provides a default configuration to create a new memory publisher counter object by best effort.

func (*CounterConfig) Help

func (cc *CounterConfig) Help() string

func (*CounterConfig) Labels

func (cc *CounterConfig) Labels() []string

func (*CounterConfig) Name

func (cc *CounterConfig) Name() string

func (*CounterConfig) SetHelp

func (cc *CounterConfig) SetHelp(help string)

func (*CounterConfig) SetLabels

func (cc *CounterConfig) SetLabels(labels []string)

func (*CounterConfig) SetName

func (cc *CounterConfig) SetName(name string)

type Gauge

type Gauge struct {
}

func NewGauge

func NewGauge(config spec.GaugeConfig) (*Gauge, error)

NewGauge creates a new configured memory publisher gauge.

func (*Gauge) Decrement

func (g *Gauge) Decrement(delta float64) error

func (*Gauge) DecrementWithLabels

func (g *Gauge) DecrementWithLabels(delta float64, values ...string) error

func (*Gauge) Increment

func (g *Gauge) Increment(delta float64) error

func (*Gauge) IncrementWithLabels

func (g *Gauge) IncrementWithLabels(delta float64, values ...string) error

func (*Gauge) Set

func (g *Gauge) Set(value float64) error

func (*Gauge) SetWithLabels

func (g *Gauge) SetWithLabels(value float64, values ...string) error

type GaugeConfig

type GaugeConfig struct {
	// contains filtered or unexported fields
}

GaugeConfig represents the configuration used to create a new memory publisher gauge.

func DefaultGaugeConfig

func DefaultGaugeConfig() *GaugeConfig

DefaultGaugeConfig provides a default configuration to create a new memory publisher gauge by best effort.

func (*GaugeConfig) Help

func (gc *GaugeConfig) Help() string

func (*GaugeConfig) Labels

func (gc *GaugeConfig) Labels() []string

func (*GaugeConfig) Name

func (gc *GaugeConfig) Name() string

func (*GaugeConfig) SetHelp

func (gc *GaugeConfig) SetHelp(help string)

func (*GaugeConfig) SetLabels

func (gc *GaugeConfig) SetLabels(labels []string)

func (*GaugeConfig) SetName

func (gc *GaugeConfig) SetName(name string)

type Histogram

type Histogram struct {
}

func NewHistogram

func NewHistogram(config spec.HistogramConfig) (*Histogram, error)

NewHistogram creates a new configured memory publisher histogram.

func (*Histogram) Observe

func (h *Histogram) Observe(sample float64) error

func (*Histogram) ObserveWithLabels

func (h *Histogram) ObserveWithLabels(sample float64, values ...string) error

type HistogramConfig

type HistogramConfig struct {
	// contains filtered or unexported fields
}

HistogramConfig represents the configuration used to create a new memory publisher histogram.

func DefaultHistogramConfig

func DefaultHistogramConfig() *HistogramConfig

DefaultHistogramConfig provides a default configuration to create a new memory publisher histogram by best effort.

func (*HistogramConfig) Buckets

func (hc *HistogramConfig) Buckets() []float64

func (*HistogramConfig) Help

func (hc *HistogramConfig) Help() string

func (*HistogramConfig) Labels

func (hc *HistogramConfig) Labels() []string

func (*HistogramConfig) Name

func (hc *HistogramConfig) Name() string

func (*HistogramConfig) SetBuckets

func (hc *HistogramConfig) SetBuckets(buckets []float64)

func (*HistogramConfig) SetHelp

func (hc *HistogramConfig) SetHelp(help string)

func (*HistogramConfig) SetLabels

func (hc *HistogramConfig) SetLabels(labels []string)

func (*HistogramConfig) SetName

func (hc *HistogramConfig) SetName(name string)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(config ServiceConfig) (*Service, error)

NewService creates a new memory publisher service.

func (*Service) Boot

func (s *Service) Boot()

func (*Service) Counter

func (s *Service) Counter(config spec.CounterConfig) (spec.Counter, error)

func (*Service) CounterConfig

func (s *Service) CounterConfig() spec.CounterConfig

func (*Service) Gauge

func (s *Service) Gauge(config spec.GaugeConfig) (spec.Gauge, error)

func (*Service) GaugeConfig

func (s *Service) GaugeConfig() spec.GaugeConfig

func (*Service) HTTPEndpoint

func (s *Service) HTTPEndpoint() string

func (*Service) HTTPHandler

func (s *Service) HTTPHandler() http.Handler

func (*Service) Histogram

func (s *Service) Histogram(config spec.HistogramConfig) (spec.Histogram, error)

func (*Service) HistogramConfig

func (s *Service) HistogramConfig() spec.HistogramConfig

func (*Service) NewKey

func (s *Service) NewKey(str ...string) string

func (*Service) Prefixes

func (s *Service) Prefixes() []string

func (*Service) Shutdown

func (s *Service) Shutdown()

func (*Service) WrapFunc

func (s *Service) WrapFunc(key string, action func() error) func() error

type ServiceConfig

type ServiceConfig struct {
}

ServiceConfig represents the configuration used to create a new memory publisher service.

func DefaultServiceConfig

func DefaultServiceConfig() ServiceConfig

DefaultServiceConfig provides a default configuration to create a new memory publisher service by best effort.

Jump to

Keyboard shortcuts

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