package gorelic

import "github.com/docker/distribution/Godeps/_workspace/src/github.com/yvasiyarov/gorelic"

Package gorelic is an New Relic agent implementation for Go runtime. It collect a lot of metrics about Go scheduler, garbage collector and memory allocator and send them to NewRelic.

Index

Constants

const (
	// DefaultNewRelicPollInterval - how often we will report metrics to NewRelic.
	// Recommended values is 60 seconds
	DefaultNewRelicPollInterval = 60

	// DefaultGcPollIntervalInSeconds - how often we will get garbage collector run statistic
	// Default value is - every 10 seconds
	// During GC stat pooling - mheap will be locked, so be carefull changing this value
	DefaultGcPollIntervalInSeconds = 10

	// DefaultMemoryAllocatorPollIntervalInSeconds - how often we will get memory allocator statistic.
	// Default value is - every 60 seconds
	// During this process stoptheword() is called, so be carefull changing this value
	DefaultMemoryAllocatorPollIntervalInSeconds = 60

	//DefaultAgentGuid is plugin ID in NewRelic.
	//You should not change it unless you want to create your own plugin.
	DefaultAgentGuid = "com.github.yvasiyarov.GoRelic"

	//CurrentAgentVersion is plugin version
	CurrentAgentVersion = "0.0.6"

	//DefaultAgentName in NewRelic GUI. You can change it.
	DefaultAgentName = "Go daemon"
)

Types

type Agent

type Agent struct {
	NewrelicName                string
	NewrelicLicense             string
	NewrelicPollInterval        int
	Verbose                     bool
	CollectGcStat               bool
	CollectMemoryStat           bool
	CollectHTTPStat             bool
	GCPollInterval              int
	MemoryAllocatorPollInterval int
	AgentGUID                   string
	AgentVersion                string

	HTTPTimer metrics.Timer
	// contains filtered or unexported fields
}

Agent - is NewRelic agent implementation. Agent start separate go routine which will report data to NewRelic

func NewAgent

func NewAgent() *Agent

NewAgent build new Agent objects.

func (*Agent) Run

func (agent *Agent) Run() error

Run initialize Agent instance and start harvest go routine

func (*Agent) WrapHTTPHandler

func (agent *Agent) WrapHTTPHandler(h http.Handler) http.Handler

WrapHTTPHandler instrument HTTP handler object to collect HTTP metrics

func (*Agent) WrapHTTPHandlerFunc

func (agent *Agent) WrapHTTPHandlerFunc(h tHTTPHandlerFunc) tHTTPHandlerFunc

WrapHTTPHandlerFunc instrument HTTP handler functions to collect HTTP metrics

Source Files

agent.go doc.go gc_metrics.go gometrica.go http_metrics.go memory_metrics.go runtime_metrics.go

Directories

PathSynopsis
Godeps/_workspace/src/github.com/yvasiyarov/gorelic/examples
Version
v2.0.0-rc.1+incompatible
Published
Apr 7, 2015
Platform
linux/amd64
Imports
12 packages
Last checked
20 hours ago

Tools for package owners.