Documentation ¶
Index ¶
- Variables
- func DisableMetrics()
- func InitMetrics(c *Config)
- func SendFindMetrics(r *FindMetrics, statusCode int, durationMs, untilFromS int64, extended bool, ...)
- func SendQueryRead(r *QueryMetrics, ...)
- func SendQueryReadByTable(table string, ...)
- func SendQueryReadChecked(r *QueryMetrics, ...)
- func SendRenderMetrics(r *RenderMetrics, statusCode int, start, fetch, end time.Time, ...)
- func UnregisterAll()
- type CacheMetric
- type Config
- type FindMetrics
- type NullSender
- func (NullSender) Close() error
- func (NullSender) Dec(string, int64, float32, ...statsd.Tag) error
- func (NullSender) Gauge(string, int64, float32, ...statsd.Tag) error
- func (NullSender) GaugeDelta(string, int64, float32, ...statsd.Tag) error
- func (NullSender) Inc(string, int64, float32, ...statsd.Tag) error
- func (NullSender) NewSubStatter(string) statsd.SubStatter
- func (NullSender) Raw(string, string, float32, ...statsd.Tag) error
- func (NullSender) Set(string, string, float32, ...statsd.Tag) error
- func (NullSender) SetInt(string, int64, float32, ...statsd.Tag) error
- func (NullSender) SetPrefix(string)
- func (NullSender) SetSamplerFunc(statsd.SamplerFunc)
- func (NullSender) Timing(string, int64, float32, ...statsd.Tag) error
- func (NullSender) TimingDuration(string, time.Duration, float32, ...statsd.Tag) error
- type QueryMetric
- type QueryMetrics
- type RenderMetric
- type RenderMetrics
- type ReqMetric
Constants ¶
This section is empty.
Variables ¶
View Source
var Graphite *graphite.Graphite
View Source
var Gstatsd statsd.Statter = NullSender{}
Functions ¶
func DisableMetrics ¶
func DisableMetrics()
func InitMetrics ¶
func InitMetrics(c *Config)
func SendFindMetrics ¶
func SendFindMetrics(r *FindMetrics, statusCode int, durationMs, untilFromS int64, extended bool, metricsCount int64)
func SendQueryRead ¶
func SendQueryRead(r *QueryMetrics, from, until, durationMs, read_rows, read_bytes, ch_read_rows, ch_read_bytes int64, err bool)
func SendQueryReadByTable ¶
func SendQueryReadChecked ¶
func SendQueryReadChecked(r *QueryMetrics, from, until, durationMs, read_rows, read_bytes, ch_read_rows, ch_read_bytes int64, err bool)
func SendRenderMetrics ¶
func UnregisterAll ¶
func UnregisterAll()
Types ¶
type CacheMetric ¶
type CacheMetric struct { CacheHits metrics.Counter CacheMisses metrics.Counter }
var DefaultCacheMetrics *CacheMetric
var FinderCacheMetrics *CacheMetric
var ShortCacheMetrics *CacheMetric
type Config ¶
type Config struct { MetricEndpoint string `toml:"metric-endpoint" json:"metric-endpoint" comment:"graphite relay address"` Statsd string `toml:"statsd-endpoint" json:"statsd-endpoint" comment:"statsd server address"` MetricInterval time.Duration `toml:"metric-interval" json:"metric-interval" comment:"graphite metrics send interval"` MetricTimeout time.Duration `toml:"metric-timeout" json:"metric-timeout" comment:"graphite metrics send timeout"` MetricPrefix string `toml:"metric-prefix" json:"metric-prefix" comment:"graphite metrics prefix"` BucketsWidth []int64 `toml:"request-buckets" json:"request-buckets" comment:"Request historgram buckets widths"` BucketsLabels []string `toml:"request-labels" json:"request-labels" comment:"Request historgram buckets labels"` Ranges map[string]time.Duration `toml:"ranges" json:"ranges" comment:"Additional separate stats for until-from ranges"` FindRanges map[string]time.Duration `toml:"find-ranges" json:"find-ranges" comment:"Additional separate stats for until-from find ranges"` // for future use, not needed at now ExtendedStat bool `toml:"extended-stat" json:"extended-stat" comment:"Extended metrics"` RangeNames []string `toml:"-" json:"-"` RangeS []int64 `toml:"-" json:"-"` FindRangeNames []string `toml:"-" json:"-"` FindRangeS []int64 `toml:"-" json:"-"` }
type NullSender ¶
type NullSender struct{}
NullSender is disabled sender (if stat need to be disabled)
func (NullSender) Close ¶
func (NullSender) Close() error
func (NullSender) GaugeDelta ¶
func (NullSender) NewSubStatter ¶
func (NullSender) NewSubStatter(string) statsd.SubStatter
func (NullSender) SetPrefix ¶
func (NullSender) SetPrefix(string)
func (NullSender) SetSamplerFunc ¶
func (NullSender) SetSamplerFunc(statsd.SamplerFunc)
func (NullSender) TimingDuration ¶
type QueryMetric ¶
type QueryMetrics ¶
type QueryMetrics struct { QueryMetric RangeNames []string RangeS []int64 RangeMetrics []QueryMetric }
var ( QMetrics map[string]*QueryMetrics = make(map[string]*QueryMetrics) AutocompleteQMetric *QueryMetrics FindQMetric *QueryMetrics )
func InitQueryMetrics ¶
func InitQueryMetrics(table string, c *Config) *QueryMetrics
type RenderMetric ¶
type RenderMetric struct { ReqMetric FinderH metrics.Histogram }
type RenderMetrics ¶
type RenderMetrics struct { RenderMetric RangeNames []string RangeS []int64 RangeMetrics []RenderMetric }
var RenderRequestMetric *RenderMetrics
type ReqMetric ¶
type ReqMetric struct { RequestsH metrics.Histogram Errors metrics.Counter Requests200 metrics.Counter Requests400 metrics.Counter Requests403 metrics.Counter Requests404 metrics.Counter Requests500 metrics.Counter Requests503 metrics.Counter Requests504 metrics.Counter Requests5xx metrics.Counter // failback other 5xx statuses Requests4xx metrics.Counter // failback other statuses MetricsCountName string PointsCountName string }
Click to show internal directories.
Click to hide internal directories.