Documentation
¶
Index ¶
- type GoKitMetrics
- type Influx
- type InfluxMetrics
- func (m *InfluxMetrics) NewCounter(name string) metrics.Counter
- func (m *InfluxMetrics) NewGauge(name string) metrics.Gauge
- func (m *InfluxMetrics) NewHistogram(name string) metrics.Histogram
- func (m *InfluxMetrics) Ping(timeout time.Duration) (time.Duration, string, error)
- func (m *InfluxMetrics) WriteLoop(c <-chan time.Time)
- type NoopCockroach
- type NoopCounter
- type NoopGauge
- type NoopHistogram
- type NoopMetrics
- func (m *NoopMetrics) NewCounter(name string) metrics.Counter
- func (m *NoopMetrics) NewGauge(name string) metrics.Gauge
- func (m *NoopMetrics) NewHistogram(name string) metrics.Histogram
- func (m *NoopMetrics) Ping(timeout time.Duration) (time.Duration, string, error)
- func (m *NoopMetrics) WriteLoop(c <-chan time.Time)
- type NoopRedis
- type NoopResult
- type NoopSentry
- type Redis
- type RedisWriter
- type Sentry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoKitMetrics ¶
type GoKitMetrics interface {
NewCounter(name string) *metric.Counter
NewGauge(name string) *metric.Gauge
NewHistogram(name string) *metric.Histogram
WriteLoop(c <-chan time.Time, w metric.BatchPointsWriter)
}
GoKitMetrics is the interface of the go-kit metrics.
type Influx ¶
type Influx interface {
Ping(timeout time.Duration) (time.Duration, string, error)
Write(bp influx.BatchPoints) error
Close() error
}
Influx is the Influx client interface.
type InfluxMetrics ¶
type InfluxMetrics struct {
// contains filtered or unexported fields
}
InfluxMetrics sends metrics to the Influx DB.
func NewMetrics ¶
func NewMetrics(influx Influx, metrics GoKitMetrics) *InfluxMetrics
NewMetrics returns an InfluxMetrics.
func (*InfluxMetrics) NewCounter ¶
func (m *InfluxMetrics) NewCounter(name string) metrics.Counter
NewCounter returns a go-kit Counter.
func (*InfluxMetrics) NewGauge ¶
func (m *InfluxMetrics) NewGauge(name string) metrics.Gauge
NewGauge returns a go-kit Gauge.
func (*InfluxMetrics) NewHistogram ¶
func (m *InfluxMetrics) NewHistogram(name string) metrics.Histogram
NewHistogram returns a go-kit Histogram.
func (*InfluxMetrics) Ping ¶
Ping test the connection to the Influx DB.
func (*InfluxMetrics) WriteLoop ¶
func (m *InfluxMetrics) WriteLoop(c <-chan time.Time)
WriteLoop writes the data to the Influx DB.
type NoopCockroach ¶
type NoopCockroach struct{}
NoopCockroach is a cockroach client that does nothing.
func (NoopCockroach) Exec ¶
func (NoopCockroach) Exec(query string, args ...interface{}) (sql.Result, error)
Exec does nothing.
func (NoopCockroach) Query ¶
func (NoopCockroach) Query(query string, args ...interface{}) (*sql.Rows, error)
Query does nothing.
func (NoopCockroach) QueryRow ¶
func (NoopCockroach) QueryRow(query string, args ...interface{}) *sql.Row
QueryRow does nothing.
type NoopCounter ¶
type NoopCounter struct{}
NoopCounter is a Counter that does nothing.
func (*NoopCounter) With ¶
func (c *NoopCounter) With(labelValues ...string) metrics.Counter
With does nothing.
type NoopHistogram ¶
type NoopHistogram struct{}
NoopHistogram is an Histogram that does nothing.
func (*NoopHistogram) Observe ¶
func (h *NoopHistogram) Observe(value float64)
Observe does nothing.
func (*NoopHistogram) With ¶
func (h *NoopHistogram) With(labelValues ...string) metrics.Histogram
With does nothing.
type NoopMetrics ¶
type NoopMetrics struct{}
NoopMetrics is an Influx metrics that does nothing.
func (*NoopMetrics) NewCounter ¶
func (m *NoopMetrics) NewCounter(name string) metrics.Counter
NewCounter returns a Counter that does nothing.
func (*NoopMetrics) NewGauge ¶
func (m *NoopMetrics) NewGauge(name string) metrics.Gauge
NewGauge returns a Gauge that does nothing.
func (*NoopMetrics) NewHistogram ¶
func (m *NoopMetrics) NewHistogram(name string) metrics.Histogram
NewHistogram returns an Histogram that does nothing.
func (*NoopMetrics) Ping ¶
Ping does nothing.
func (*NoopMetrics) WriteLoop ¶
func (m *NoopMetrics) WriteLoop(c <-chan time.Time)
WriteLoop does nothing.
type NoopRedis ¶
type NoopRedis struct{}
NoopRedis is a Redis client that does nothing.
func (*NoopRedis) Do ¶
Do does nothing.
type NoopResult ¶
type NoopResult struct{}
NoopResult is a sql.Result that does nothing.
func (NoopResult) LastInsertId ¶
func (NoopResult) LastInsertId() (int64, error)
LastInsertId does nothing.
func (NoopResult) RowsAffected ¶
func (NoopResult) RowsAffected() (int64, error)
RowsAffected does nothing.
type NoopSentry ¶
type NoopSentry struct{}
NoopSentry is a Sentry client that does nothing.
type Redis ¶
Redis is the redis client interface.
type RedisWriter ¶
type RedisWriter struct {
// contains filtered or unexported fields
}
RedisWriter encodes logs in logstash format and writes them to Redis.
func NewLogstashRedisWriter ¶
func NewLogstashRedisWriter(redis Redis, key string) *RedisWriter
NewLogstashRedisWriter returns a writer that writes logs into a redis DB.
func (*RedisWriter) Write ¶
func (w *RedisWriter) Write(data []byte) (int, error)
Write encodes logs in logstash format and writes them to Redis.
Source Files
¶
- cockroach.go
- instrumenting.go
- logging.go
- tracking.go