Versions in this module Expand all Collapse all v0 v0.2.0 Apr 20, 2023 v0.1.1 Apr 18, 2023 Changes in this version + const OutputDatadog + const OutputNull + var StatFromContext = xstats.FromContext + type Component struct + Datadog *DatadogComponent + NullStat *NullComponent + func NewComponent() *Component + func (c *Component) New(ctx context.Context, conf *Config) (Stat, error) + func (c *Component) Settings() *Config + type Config struct + Datadog *DatadogConfig + NullStat *NullConfig + Output string + func (*Config) Name() string + type CountAggregator struct + Bucket map[StatTagKey]float64 + FlushInterval time.Duration + Stater xstats.XStater + func (ca *CountAggregator) AddTags(tags ...string) + func (ca *CountAggregator) Count(stat string, count float64, tags ...string) + func (ca *CountAggregator) Gauge(stat string, value float64, tags ...string) + func (ca *CountAggregator) GetTags() []string + func (ca *CountAggregator) Histogram(stat string, value float64, tags ...string) + func (ca *CountAggregator) Timing(stat string, duration time.Duration, tags ...string) + type CountAggregatorComponent struct + StatComponent *DatadogComponent + func (c *CountAggregatorComponent) New(ctx context.Context, conf *CountAggregatorConfig) (xstats.XStater, error) + func (c *CountAggregatorComponent) Settings() *CountAggregatorConfig + type CountAggregatorConfig struct + FlushInterval time.Duration + StatConfig *DatadogConfig + func (*CountAggregatorConfig) Name() string + type DatadogComponent struct + func (*DatadogComponent) New(_ context.Context, conf *DatadogConfig) (Stat, error) + func (*DatadogComponent) Settings() *DatadogConfig + type DatadogConfig struct + Address string + FlushInterval time.Duration + PacketSize int + Tags []string + func (*DatadogConfig) Name() string + type NullComponent struct + func (*NullComponent) New(_ context.Context, conf *NullConfig) (Stat, error) + func (*NullComponent) Settings() *NullConfig + type NullConfig struct + func (*NullConfig) Name() string + type Stat = xstats.XStater + func Load(ctx context.Context, source settings.Source, c *Component) (Stat, error) + func New(ctx context.Context, source settings.Source) (Stat, error) + type StatFn func(context.Context) Stat + type StatTagKey struct + StatKey string + TagsKey string