Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/go-stathat
Stathat client with batching support.
https://github.com/segment-boneyard/go-stathat
Last synced: about 7 hours ago
JSON representation
Stathat client with batching support.
- Host: GitHub
- URL: https://github.com/segment-boneyard/go-stathat
- Owner: segment-boneyard
- Created: 2015-01-26T23:38:40.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-09T22:31:00.000Z (almost 10 years ago)
- Last Synced: 2024-06-20T18:35:51.855Z (5 months ago)
- Language: Go
- Size: 148 KB
- Stars: 7
- Watchers: 50
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# go-stathat
Stathat client with batch support.
## Usage
```go
var Endpoint = "http://api.stathat.com/ez"
```
EZ endpoint.#### type Client
```go
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
```go
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
```go
func (c *Client) Close() error
```
Close and flush metrics.#### func (*Client) Count
```go
func (c *Client) Count(name string, n int64) error
```
Count for `name`.#### func (*Client) CountTime
```go
func (c *Client) CountTime(name string, n int64, t time.Time) error
```
Count for `name` with explicit time.#### func (*Client) Value
```go
func (c *Client) Value(name string, n float64) error
```
Value for `name`.#### func (*Client) ValueTime
```go
func (c *Client) ValueTime(name string, n float64, t time.Time) error
```
Value for `name` with explicit time.## License
MIT