Documentation ¶
Overview ¶
Package newrelic_platform_go is New Relic Platform Agent SDK for Go language.
Index ¶
- Constants
- type Agent
- type AggregatedMetricaValue
- type ComponentData
- type IComponent
- type IMetrica
- type INewrelicPlugin
- type MetricaValue
- type NewrelicPlugin
- func (plugin *NewrelicPlugin) AddComponent(component IComponent)
- func (plugin *NewrelicPlugin) CheckResponse(httpResponseCode int) (error, bool)
- func (plugin *NewrelicPlugin) ClearSentData()
- func (plugin *NewrelicPlugin) GetMetricaKey(metrica IMetrica) string
- func (plugin *NewrelicPlugin) Harvest() error
- func (plugin *NewrelicPlugin) Run()
- func (plugin *NewrelicPlugin) SendMetricas() (int, error)
- type PluginComponent
- type SimpleMetricaValue
Constants ¶
View Source
const (
NEWRELIC_API_URL = "https://platform-api.newrelic.com/platform/v1/metrics"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { Host string `json:"host"` Version string `json:"version"` Pid int `json:"pid"` }
func (*Agent) CollectEnvironmentInfo ¶
func (agent *Agent) CollectEnvironmentInfo()
type AggregatedMetricaValue ¶
type AggregatedMetricaValue struct { Min float64 `json:"min"` Max float64 `json:"max"` Total float64 `json:"total"` Count int `json:"count"` SumOfSquares float64 `json:"sum_of_squares"` }
func NewAggregatedMetricaValue ¶
func NewAggregatedMetricaValue(existValue float64, newValue float64) *AggregatedMetricaValue
func (*AggregatedMetricaValue) Aggregate ¶
func (aggregatedValue *AggregatedMetricaValue) Aggregate(newValue float64)
type ComponentData ¶
type ComponentData interface{}
type IComponent ¶
type IComponent interface { Harvest(plugin INewrelicPlugin) ComponentData SetDuration(duration int) AddMetrica(model IMetrica) ClearSentData() }
type INewrelicPlugin ¶
type INewrelicPlugin interface { GetMetricaKey(metrica IMetrica) string Harvest() error Run() AddComponent(component IComponent) }
type MetricaValue ¶
type MetricaValue interface{}
type NewrelicPlugin ¶
type NewrelicPlugin struct { Agent *Agent `json:"agent"` Components []ComponentData `json:"components"` ComponentModels []IComponent `json:"-"` LastPollTime time.Time `json:"-"` Verbose bool `json:"-"` LicenseKey string `json:"-"` PollIntervalInSecond int `json:"-"` }
func NewNewrelicPlugin ¶
func NewNewrelicPlugin(version string, licenseKey string, pollInterval int) *NewrelicPlugin
func (*NewrelicPlugin) AddComponent ¶
func (plugin *NewrelicPlugin) AddComponent(component IComponent)
func (*NewrelicPlugin) CheckResponse ¶
func (plugin *NewrelicPlugin) CheckResponse(httpResponseCode int) (error, bool)
func (*NewrelicPlugin) ClearSentData ¶
func (plugin *NewrelicPlugin) ClearSentData()
func (*NewrelicPlugin) GetMetricaKey ¶
func (plugin *NewrelicPlugin) GetMetricaKey(metrica IMetrica) string
func (*NewrelicPlugin) Harvest ¶
func (plugin *NewrelicPlugin) Harvest() error
func (*NewrelicPlugin) Run ¶
func (plugin *NewrelicPlugin) Run()
func (*NewrelicPlugin) SendMetricas ¶
func (plugin *NewrelicPlugin) SendMetricas() (int, error)
type PluginComponent ¶
type PluginComponent struct { Name string `json:"name"` GUID string `json:"guid"` Duration int `json:"duration"` Metrics map[string]MetricaValue `json:"metrics"` MetricaModels []IMetrica `json:"-"` }
func NewPluginComponent ¶
func NewPluginComponent(name string, guid string) *PluginComponent
func (*PluginComponent) AddMetrica ¶
func (component *PluginComponent) AddMetrica(model IMetrica)
func (*PluginComponent) ClearSentData ¶
func (component *PluginComponent) ClearSentData()
func (*PluginComponent) Harvest ¶
func (component *PluginComponent) Harvest(plugin INewrelicPlugin) ComponentData
func (*PluginComponent) SetDuration ¶
func (component *PluginComponent) SetDuration(duration int)
type SimpleMetricaValue ¶
type SimpleMetricaValue float64
Click to show internal directories.
Click to hide internal directories.