Skip to content

segment-boneyard/go-stathat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-stathat

Stathat client with batch support.

Usage

var Endpoint = "http://api.stathat.com/ez"

EZ endpoint.

type Client

type Client struct {
  Verbose  bool
  Interval time.Duration
  Size     int
}

Client which batches stats and flushes at the given Interval or when the Size limit is exceeded. Set Verbose to true to enable logging output.

func New

func New(key string) *Client

New return a client with "EZ key" and default buffer size of 1000 and interval of 1s.

func (*Client) Close

func (c *Client) Close() error

Close and flush metrics.

func (*Client) Count

func (c *Client) Count(name string, n int64) error

Count for name.

func (*Client) CountTime

func (c *Client) CountTime(name string, n int64, t time.Time) error

Count for name with explicit time.

func (*Client) Value

func (c *Client) Value(name string, n float64) error

Value for name.

func (*Client) ValueTime

func (c *Client) ValueTime(name string, n float64, t time.Time) error

Value for name with explicit time.

License

MIT

About

Stathat client with batching support.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages