Documentation ¶
Overview ¶
Go client for Librato Metrics
Index ¶
- Constants
- type CollatedMetrics
- func (m *CollatedMetrics) Close()
- func (m *CollatedMetrics) GetCounter(name string) chan int64
- func (m *CollatedMetrics) GetCustomCounter(name string) chan map[string]int64
- func (m *CollatedMetrics) GetCustomGauge(name string) chan map[string]int64
- func (m *CollatedMetrics) GetGauge(name string) chan int64
- func (m *CollatedMetrics) NewCounter(name string) chan int64
- func (m *CollatedMetrics) NewCustomCounter(name string) chan map[string]int64
- func (m *CollatedMetrics) NewCustomGauge(name string) chan map[string]int64
- func (m *CollatedMetrics) NewGauge(name string) chan int64
- func (m *CollatedMetrics) SetTransport(transport http.RoundTripper)
- func (m *CollatedMetrics) Wait()
- type Metrics
- type SimpleMetrics
- func (m *SimpleMetrics) Close()
- func (m *SimpleMetrics) GetCounter(name string) chan int64
- func (m *SimpleMetrics) GetCustomCounter(name string) chan map[string]int64
- func (m *SimpleMetrics) GetCustomGauge(name string) chan map[string]int64
- func (m *SimpleMetrics) GetGauge(name string) chan int64
- func (m *SimpleMetrics) NewCounter(name string) chan int64
- func (m *SimpleMetrics) NewCustomCounter(name string) chan map[string]int64
- func (m *SimpleMetrics) NewCustomGauge(name string) chan map[string]int64
- func (m *SimpleMetrics) NewGauge(name string) chan int64
- func (m *SimpleMetrics) SetTransport(transport http.RoundTripper)
- func (m *SimpleMetrics) Wait()
Constants ¶
const Version = "0.1"
Set the UserAgent string
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollatedMetrics ¶
type CollatedMetrics struct {
// contains filtered or unexported fields
}
Librato `CollatedMetrics` structs encapsulate the credentials used to send metrics to the API, the source tag for these metrics, the maximum number of metrics to collate, bookkeeping for goroutines, and lookup tables for existing metric channels.
func (*CollatedMetrics) Close ¶
func (m *CollatedMetrics) Close()
Close all metric channels so no new messages may be sent. This is a prerequisite to `Wait`ing.
func (*CollatedMetrics) GetCounter ¶
func (m *CollatedMetrics) GetCounter(name string) chan int64
Get (possibly by creating) a counter channel by the given name.
func (*CollatedMetrics) GetCustomCounter ¶
func (m *CollatedMetrics) GetCustomCounter(name string) chan map[string]int64
Get (possibly by creating) a custom counter channel by the given name.
func (*CollatedMetrics) GetCustomGauge ¶
func (m *CollatedMetrics) GetCustomGauge(name string) chan map[string]int64
Get (possibly by creating) a custom gauge channel by the given name.
func (*CollatedMetrics) GetGauge ¶
func (m *CollatedMetrics) GetGauge(name string) chan int64
Get (possibly by creating) a gauge channel by the given name.
func (*CollatedMetrics) NewCounter ¶
func (m *CollatedMetrics) NewCounter(name string) chan int64
Create a counter channel by the given name.
func (*CollatedMetrics) NewCustomCounter ¶
func (m *CollatedMetrics) NewCustomCounter(name string) chan map[string]int64
Create a custom counter channel by the given name.
func (*CollatedMetrics) NewCustomGauge ¶
func (m *CollatedMetrics) NewCustomGauge(name string) chan map[string]int64
Create a custom gauge channel by the given name.
func (*CollatedMetrics) NewGauge ¶
func (m *CollatedMetrics) NewGauge(name string) chan int64
Create a gauge channel by the given name.
func (*CollatedMetrics) SetTransport ¶
func (m *CollatedMetrics) SetTransport(transport http.RoundTripper)
SetTransport lets us use a custom Roundtripper Useful in-case some other part of the program overrides http.DefaultClient / http.DefaultTransport
func (*CollatedMetrics) Wait ¶
func (m *CollatedMetrics) Wait()
Wait for all outstanding HTTP requests to finish. This must be called after `Close` has been called.
type Metrics ¶
type Metrics interface { Close() GetCounter(name string) chan int64 GetCustomCounter(name string) chan map[string]int64 GetCustomGauge(name string) chan map[string]int64 GetGauge(name string) chan int64 NewCounter(name string) chan int64 NewCustomCounter(name string) chan map[string]int64 NewCustomGauge(name string) chan map[string]int64 NewGauge(name string) chan int64 Wait() }
func NewCollatedMetrics ¶
Create a new `CollatedMetrics` struct with the given credentials, source tag, and maximum collation. Initialize all the channels, maps, and goroutines used internally.
func NewMetrics ¶
func NewSimpleMetrics ¶
Create a new `SimpleMetrics` struct with the given credentials and source tag. Initialize all the channels, maps, and goroutines used internally.
type SimpleMetrics ¶
type SimpleMetrics struct {
// contains filtered or unexported fields
}
Librato `SimpleMetrics` structs encapsulate the credentials used to send metrics to the API, the source tag for these metrics, bookkeeping for goroutines, and lookup tables for existing metric channels.
func (*SimpleMetrics) Close ¶
func (m *SimpleMetrics) Close()
Close all metric channels so no new messages may be sent. This is a prerequisite to `Wait`ing.
func (*SimpleMetrics) GetCounter ¶
func (m *SimpleMetrics) GetCounter(name string) chan int64
Get (possibly by creating) a counter channel by the given name.
func (*SimpleMetrics) GetCustomCounter ¶
func (m *SimpleMetrics) GetCustomCounter(name string) chan map[string]int64
Get (possibly by creating) a custom counter channel by the given name.
func (*SimpleMetrics) GetCustomGauge ¶
func (m *SimpleMetrics) GetCustomGauge(name string) chan map[string]int64
Get (possibly by creating) a custom gauge channel by the given name.
func (*SimpleMetrics) GetGauge ¶
func (m *SimpleMetrics) GetGauge(name string) chan int64
Get (possibly by creating) a gauge channel by the given name.
func (*SimpleMetrics) NewCounter ¶
func (m *SimpleMetrics) NewCounter(name string) chan int64
Create a counter channel by the given name.
func (*SimpleMetrics) NewCustomCounter ¶
func (m *SimpleMetrics) NewCustomCounter(name string) chan map[string]int64
Create a custom counter channel by the given name.
func (*SimpleMetrics) NewCustomGauge ¶
func (m *SimpleMetrics) NewCustomGauge(name string) chan map[string]int64
Create a custom gauge channel by the given name.
func (*SimpleMetrics) NewGauge ¶
func (m *SimpleMetrics) NewGauge(name string) chan int64
Create a gauge channel by the given name.
func (*SimpleMetrics) SetTransport ¶
func (m *SimpleMetrics) SetTransport(transport http.RoundTripper)
SetTransport lets us use a custom Roundtripper Useful in-case some other part of the program overrides http.DefaultClient / http.DefaultTransport
func (*SimpleMetrics) Wait ¶
func (m *SimpleMetrics) Wait()
Wait for all outstanding HTTP requests to finish. This must be called after `Close` has been called.