Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultReporter does not do anything // TODO(glib): add a logging reporter and use it by default, rather than noop DefaultReporter = NopCachedStatsReporter )
var NopCachedCount tally.CachedCount = nopCachedCount{}
NopCachedCount is an implementation of tally.CachedCount and same as other Nop types don't do anything and should be used for testing purposes only.
var NopCachedGauge tally.CachedGauge = nopCachedGauge{}
NopCachedGauge is an implementation of tally.CachedGauge and same as other Nop types don't do anything and should be used for testing purposes only.
var NopCachedHistogram tally.CachedHistogram = nopCachedHistogram{}
NopCachedHistogram is an implementation of tally.CachedHistogram and same as other Nop types don't do anything and should be used for testing purposes only.
var NopCachedHistogramBucket tally.CachedHistogramBucket = nopCachedHistogramBucket{}
NopCachedHistogramBucket is an implementation of tally.CachedHistogramBucket and same as other Nop types don't do anything and should be used for testing purposes only.
var NopCachedStatsReporter tally.CachedStatsReporter = nopCachedStatsReporter{}
NopCachedStatsReporter is an implementation of tally.CachedStatsReporter that simply does nothing and should be used for testing purposes only. TODO:(anup) This should exist in tally. https://github.com/uber-go/tally/issues/23 Remove and replace metrics.NopCachedStatsReporter with tally.NopCachedStatsReporter once issue is resolved
var NopCachedTimer tally.CachedTimer = nopCachedTimer{}
NopCachedTimer is an implementation of tally.CachedTimer
Functions ¶
func Freeze ¶
func Freeze()
Freeze ensures that after service is started, no other metrics manipulations can be done
This has to do with the fact that modules inherit sub-scopes of the main metrics, and the fact that swapping a reporter might have unpredicted implications on already emitted metrics.
No, really, metrics must be set up before starting the service.
func RegisterRootScope ¶
func RegisterRootScope(scopeFunc ScopeFunc)
RegisterRootScope initializes the root scope for all the service metrics
Types ¶
type RuntimeCollector ¶
type RuntimeCollector struct {
// contains filtered or unexported fields
}
RuntimeCollector is a struct containing the state of the runtimeMetrics.
func NewRuntimeCollector ¶
func NewRuntimeCollector( scope tally.Scope, collectInterval time.Duration, ) *RuntimeCollector
NewRuntimeCollector creates a new RuntimeCollector.
func StartCollectingRuntimeMetrics ¶
func StartCollectingRuntimeMetrics( scope tally.Scope, collectInterval time.Duration, config RuntimeConfig, ) *RuntimeCollector
StartCollectingRuntimeMetrics starts generating runtime metrics under given metrics scope with given frequency. Recommended usage:
rmr := StartCollectingRuntimeMetrics(rootScope.Scope("runtime"), time.Second) ... rmr.Close()
func (*RuntimeCollector) Close ¶
func (r *RuntimeCollector) Close()
Close stops collecting runtime metrics. It cannot be started again after it's been stopped.
func (*RuntimeCollector) IsRunning ¶
func (r *RuntimeCollector) IsRunning() bool
IsRunning returns true if the collector has been started and false if not.
func (*RuntimeCollector) Start ¶
func (r *RuntimeCollector) Start()
Start starts the collector thread that periodically emits metrics.
type RuntimeConfig ¶
type RuntimeConfig struct {
Disabled bool `yaml:"disabled"`
}
RuntimeConfig contains configuration for initializing runtime metrics