Documentation ¶
Index ¶
- func CollectMemStats(registry *Registry)
- func CollectRuntimeMetrics(registry *Registry)
- func CollectSysStats(registry *Registry)
- type Clock
- type Config
- type Counter
- type DefaultLogger
- type DistributionSummary
- type Gauge
- type HttpClient
- type Id
- func (id *Id) MapKey() string
- func (id *Id) Name() string
- func (id *Id) String() string
- func (id *Id) Tags() map[string]string
- func (id *Id) WithDefaultStat(stat string) *Id
- func (id *Id) WithStat(stat string) *Id
- func (id *Id) WithTag(key string, value string) *Id
- func (id *Id) WithTags(tags map[string]string) *Id
- type LogEntry
- type Logger
- type ManualClock
- type Measurement
- type Meter
- type MeterFactoryFun
- type MonotonicCounter
- type Registry
- func (r *Registry) Clock() Clock
- func (r *Registry) Counter(name string, tags map[string]string) *Counter
- func (r *Registry) CounterWithId(id *Id) *Counter
- func (r *Registry) DistributionSummary(name string, tags map[string]string) *DistributionSummary
- func (r *Registry) DistributionSummaryWithId(id *Id) *DistributionSummary
- func (r *Registry) Gauge(name string, tags map[string]string) *Gauge
- func (r *Registry) GaugeWithId(id *Id) *Gauge
- func (r *Registry) GetLogger() Logger
- func (r *Registry) Measurements() []Measurement
- func (r *Registry) Meters() []Meter
- func (r *Registry) NewId(name string, tags map[string]string) *Id
- func (r *Registry) NewMeter(id *Id, meterFactory MeterFactoryFun) Meter
- func (r *Registry) SetLogger(logger Logger)
- func (r *Registry) Start() error
- func (r *Registry) Stop()
- func (r *Registry) Timer(name string, tags map[string]string) *Timer
- func (r *Registry) TimerWithId(id *Id) *Timer
- type SystemClock
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectMemStats ¶
func CollectMemStats(registry *Registry)
Collect memory stats https://golang.org/pkg/runtime/#MemStats
func CollectRuntimeMetrics ¶
func CollectRuntimeMetrics(registry *Registry)
Starts the collection of memory and file handle metrics
func CollectSysStats ¶
func CollectSysStats(registry *Registry)
Collects system stats: current/max file handles, number of goroutines
Types ¶
type Config ¶
type Config struct { Frequency time.Duration `json:"frequency"` Timeout time.Duration `json:"timeout"` Uri string `json:"uri"` BatchSize int `json:"batch_size"` CommonTags map[string]string `json:"common_tags"` Log Logger IsEnabled func() bool IpcTimerRecord func(registry *Registry, id *Id, duration time.Duration) }
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
func NewCounter ¶
func (*Counter) Measure ¶
func (c *Counter) Measure() []Measurement
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
func (*DefaultLogger) Debugf ¶
func (l *DefaultLogger) Debugf(format string, v ...interface{})
func (*DefaultLogger) Errorf ¶
func (l *DefaultLogger) Errorf(format string, v ...interface{})
func (*DefaultLogger) Infof ¶
func (l *DefaultLogger) Infof(format string, v ...interface{})
type DistributionSummary ¶
type DistributionSummary struct {
// contains filtered or unexported fields
}
func NewDistributionSummary ¶
func NewDistributionSummary(id *Id) *DistributionSummary
func (*DistributionSummary) Count ¶
func (d *DistributionSummary) Count() int64
func (*DistributionSummary) Measure ¶
func (d *DistributionSummary) Measure() []Measurement
func (*DistributionSummary) MeterId ¶
func (d *DistributionSummary) MeterId() *Id
func (*DistributionSummary) Record ¶
func (d *DistributionSummary) Record(amount int64)
func (*DistributionSummary) TotalAmount ¶
func (d *DistributionSummary) TotalAmount() int64
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
func (*Gauge) Measure ¶
func (g *Gauge) Measure() []Measurement
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(registry *Registry, timeout time.Duration) *HttpClient
type Id ¶
type Id struct {
// contains filtered or unexported fields
}
func (*Id) WithDefaultStat ¶
type LogEntry ¶
type LogEntry struct {
// contains filtered or unexported fields
}
func (*LogEntry) SetAttempt ¶
func (*LogEntry) SetStatusCode ¶
func (*LogEntry) SetSuccess ¶
func (entry *LogEntry) SetSuccess()
type ManualClock ¶
type ManualClock struct {
// contains filtered or unexported fields
}
func (*ManualClock) Nanos ¶
func (c *ManualClock) Nanos() int64
func (*ManualClock) Now ¶
func (c *ManualClock) Now() time.Time
func (*ManualClock) SetFromDuration ¶
func (c *ManualClock) SetFromDuration(duration time.Duration)
func (*ManualClock) SetNanos ¶
func (c *ManualClock) SetNanos(nanos int64)
type Measurement ¶
type Measurement struct {
// contains filtered or unexported fields
}
func NewMeasurement ¶
func NewMeasurement(id *Id, Value float64) Measurement
func (Measurement) Id ¶
func (m Measurement) Id() *Id
func (Measurement) String ¶
func (m Measurement) String() string
func (Measurement) Value ¶
func (m Measurement) Value() float64
type Meter ¶
type Meter interface { MeterId() *Id Measure() []Measurement }
type MeterFactoryFun ¶
type MeterFactoryFun func() Meter
type MonotonicCounter ¶
type MonotonicCounter struct {
// contains filtered or unexported fields
}
func NewMonotonicCounter ¶
func NewMonotonicCounter(registry *Registry, name string, tags map[string]string) *MonotonicCounter
func NewMonotonicCounterWithId ¶
func NewMonotonicCounterWithId(registry *Registry, id *Id) *MonotonicCounter
func (*MonotonicCounter) Count ¶
func (c *MonotonicCounter) Count() int64
func (*MonotonicCounter) Set ¶
func (c *MonotonicCounter) Set(amount int64)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistryConfiguredBy ¶
func NewRegistryWithClock ¶
for testing
func (*Registry) CounterWithId ¶
func (*Registry) DistributionSummary ¶
func (r *Registry) DistributionSummary(name string, tags map[string]string) *DistributionSummary
func (*Registry) DistributionSummaryWithId ¶
func (r *Registry) DistributionSummaryWithId(id *Id) *DistributionSummary
func (*Registry) GaugeWithId ¶
func (*Registry) Measurements ¶
func (r *Registry) Measurements() []Measurement
func (*Registry) TimerWithId ¶
type SystemClock ¶
type SystemClock struct{}
func (*SystemClock) Nanos ¶
func (c *SystemClock) Nanos() int64
func (*SystemClock) Now ¶
func (c *SystemClock) Now() time.Time
Source Files ¶
Click to show internal directories.
Click to hide internal directories.