Documentation ¶
Overview ¶
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 ¶
View Source
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" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 (*Agent) WrapHTTPHandler ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.