tencentcloud

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 (
	// DefaultEndPoint 是默认的监控上报地址。
	DefaultEndPoint = "monitor.tencentcloudapi.com"

	// DefaultTimeout 是默认的请求超时时间。
	DefaultTimeout = 5 * time.Second

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

Variables

This section is empty.

Functions

func Register

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

Register 将腾讯云 metrics 客户端初始化。

Types

type Config

type Config struct {
	SecretID     string        `config:"secret_id"`     // 腾讯云帐号的 secret id。
	SecretKey    string        `config:"secret_key"`    // 腾讯云帐号的 secret key。
	Region       string        `config:"region"`        // 腾讯云的大区,比如 ap-guangzhou。
	EndPoint     string        `config:"end_point"`     // 腾讯云的监控上报地址,默认是 DefaultEndPoint。
	Prefix       string        `config:"prefix"`        // 腾讯云统计的前缀。
	Timeout      time.Duration `config:"timeout"`       // 发送统计请求时的最大超时,默认是 DefaultTimeout。
	SendInterval time.Duration `config:"send_interval"` // 发送统计的周期,默认为 DefaultSendInterval。
}

Config 代表腾讯云 metrics 监控的配置。

type TencentCloud

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

TencentCloud 实现了腾讯云 metrics 客户端。

func (*TencentCloud) Interval

func (tc *TencentCloud) Interval() time.Duration

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

func (*TencentCloud) Send

func (tc *TencentCloud) Send(ctx context.Context, stats *client.Stats) error

Send 将统计项发送给腾讯云。

Jump to

Keyboard shortcuts

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