Documentation
¶
Index ¶
- Constants
- type Config
- type PrometheusReporter
- func (s *PrometheusReporter) Destroy() error
- func (s *PrometheusReporter) Info() model.StatInfo
- func (s *PrometheusReporter) Init(ctx *plugin.InitContext) error
- func (s *PrometheusReporter) Name() string
- func (s *PrometheusReporter) ReportStat(metricsType model.MetricType, metricsVal model.InstanceGauge) error
- func (s *PrometheusReporter) Type() common.Type
- type PullAction
- type PushAction
- type ReportAction
Constants ¶
View Source
const (
// PluginName is the name of the plugin.
PluginName = "prometheus"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Type string `yaml:"type"`
IP string `yaml:"metricHost"`
PortStr string `yaml:"metricPort"`
Interval time.Duration `yaml:"interval"`
Address string `yaml:"address"`
// contains filtered or unexported fields
}
Config prometheus 的配置
type PrometheusReporter ¶
type PrometheusReporter struct {
*plugin.PluginBase
*common.RunContext
// contains filtered or unexported fields
}
PrometheusReporter is a prometheus reporter.
func (*PrometheusReporter) Init ¶
func (s *PrometheusReporter) Init(ctx *plugin.InitContext) error
Init 初始化插件.
func (*PrometheusReporter) ReportStat ¶
func (s *PrometheusReporter) ReportStat(metricsType model.MetricType, metricsVal model.InstanceGauge) error
ReportStat 报告统计数据.
type PullAction ¶
type PullAction struct {
// contains filtered or unexported fields
}
func (*PullAction) Init ¶
func (pa *PullAction) Init(initCtx *plugin.InitContext, reporter *PrometheusReporter)
func (*PullAction) Run ¶
func (pa *PullAction) Run(ctx context.Context)
type PushAction ¶
type PushAction struct {
// contains filtered or unexported fields
}
func (*PushAction) Init ¶
func (pa *PushAction) Init(initCtx *plugin.InitContext, reporter *PrometheusReporter)
func (*PushAction) Run ¶
func (pa *PushAction) Run(ctx context.Context)
type ReportAction ¶
type ReportAction interface {
Init(initCtx *plugin.InitContext, reporter *PrometheusReporter)
Run(ctx context.Context)
Info() model.StatInfo
}
Click to show internal directories.
Click to hide internal directories.