aliyun

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2020 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPeriod 是默认的统计周期,发送请求的时候最多以这样的频率发送统计数据。
	DefaultPeriod = time.Minute
)

Variables

This section is empty.

Functions

func Register

func Register(ctx context.Context, config *Config) error

Register 将阿里云 metrics 客户端初始化。

Types

type AliYun

type AliYun struct {
	// contains filtered or unexported fields
}

AliYun 实现了阿里云 metrics 客户端。

func (*AliYun) Interval

func (al *AliYun) Interval() time.Duration

Interval 返回发送统计的时间间隔。

func (*AliYun) Send

func (al *AliYun) Send(ctx context.Context, stats *client.Stats) error

Send 将统计项发送给阿里云。

type Config

type Config struct {
	AccessKeyID  string        `config:"access_key_id"` // 阿里云帐号的 secret id。
	AccessSecret string        `config:"access_secret"` // 阿里云帐号的 secret key。
	Region       string        `config:"region"`        // 阿里云的大区,比如 cn-hangzhou。
	GroupID      string        `config:"group_id"`      // 阿里云的应用分组 ID。
	Prefix       string        `config:"prefix"`        // 阿里云统计的前缀。
	Period       time.Duration `config:"period"`        // 发送统计的周期,默认为 DefaultSendInterval。
}

Config 代表阿里云 metrics 监控的配置。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL