Documentation ¶
Index ¶
Constants ¶
View Source
const ( UnitFloat = "float" UnitInteger = "integer" UnitPercentage = "percentage" UnitSeconds = "seconds" UnitMilliseconds = "milliseconds" UnitBytes = "bytes" UnitBytesPerSecond = "bytes/sec" UnitBitsPerSecond = "bits/sec" UnitIOPS = "iops" )
Metric units
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graphs ¶
type Graphs struct { Label string `json:"label"` Unit string `json:"unit"` Metrics []Metrics `json:"metrics"` }
Graphs represents definition of a graph
type MackerelPlugin ¶
MackerelPlugin is for mackerel-agent-plugins
func NewMackerelPlugin ¶
func NewMackerelPlugin(plugin Plugin) *MackerelPlugin
NewMackerelPlugin returns new MackrelPlugin
func (*MackerelPlugin) OutputDefinitions ¶
func (mp *MackerelPlugin) OutputDefinitions()
OutputDefinitions outputs graph definitions
func (*MackerelPlugin) OutputValues ¶
func (mp *MackerelPlugin) OutputValues()
OutputValues output the metrics
func (*MackerelPlugin) SetTempfileByBasename ¶
func (mp *MackerelPlugin) SetTempfileByBasename(base string)
SetTempfileByBasename sets Tempfile under proper directory with specified basename.
type Metrics ¶
type Metrics struct { Name string `json:"name"` Label string `json:"label"` Diff bool `json:"-"` Stacked bool `json:"stacked"` Scale float64 `json:"-"` }
Metrics represents definition of a metric
type Plugin ¶
type Plugin interface { FetchMetrics() (map[string]float64, error) GraphDefinition() map[string]Graphs }
Plugin is old interface of mackerel-plugin
type PluginWithPrefix ¶
PluginWithPrefix is recommended interface
Click to show internal directories.
Click to hide internal directories.