Documentation
¶
Overview ¶
Package eventstat contains helper to create statistics about events with unbounded cardinality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientOpts ¶
type ClientOpts struct { // Interval is how frequently stats from the provided Registry will be // sent up. Note that this interval is "jittered", so the actual interval // is taken from a normal distribution with a mean of Interval and a // variance of Interval/4. Defaults to DefaultInterval. Interval time.Duration // Application is the application name, usually prepended to metric names. // By default it will be os.Args[0]. Application string // Instance is a string that identifies this particular server. Could be a // node id, but defaults to the result of DefaultInstanceId(). Instance string // PacketSize controls how we fragment the data as it goes out in UDP // packets. Defaults to DefaultPacketSize. PacketSize int }
ClientOpts allows you to set Client Options.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry represents the collection of different event counters.
func (*Registry) NewTagCounter ¶
NewTagCounter creates an event counter which is registered to the registry.
func (*Registry) PublishAndReset ¶
PublishAndReset publishes actual statistics and reset all internal state.
type UDPPublisher ¶
type UDPPublisher struct {
// contains filtered or unexported fields
}
UDPPublisher is an eventstat telemetry client for sending UDP packets at a regular interval.
func NewUDPPublisher ¶
func NewUDPPublisher(remoteAddr string, registry *Registry, opts ClientOpts) (rv *UDPPublisher, err error)
NewUDPPublisher constructs a telemetry client that sends packets to remoteAddr over UDP.
func (*UDPPublisher) Run ¶
func (c *UDPPublisher) Run(ctx context.Context)
Run calls Report roughly every Interval.
Click to show internal directories.
Click to hide internal directories.