Documentation
¶
Index ¶
Constants ¶
View Source
const ( REPORT_TIMEOUT time.Duration = 3 * time.Second ALI_JIANKONG_NAMESPACE = "acs/custom/" ALI_JIANKONG_URL = "http://open.cms.aliyun.com/metrics/put" )
View Source
const (
ALI_JIANKONG_ERROR_NS = "ALI_JIANKONG"
)
Variables ¶
View Source
var ( ERR_SEND_JIANKONG_REPORT_FAILED = errors.TN(ALI_JIANKONG_ERROR_NS, 1, "code: {{.code}}, content: {{.content}}") ERR_REQUEST_JIANKONG_SERVER_FAILED = errors.TN(ALI_JIANKONG_ERROR_NS, 2, "error: {{.err}}") )
Functions ¶
This section is empty.
Types ¶
type AliJianKong ¶
type AliJianKong struct {
// contains filtered or unexported fields
}
func NewAliJianKong ¶
func NewAliJianKong(uid string, timeout time.Duration) *AliJianKong
func (*AliJianKong) Report ¶
func (p *AliJianKong) Report(items ...ReportItem) (err error)
func (*AliJianKong) SetTimeout ¶
func (p *AliJianKong) SetTimeout(timeout time.Duration) *AliJianKong
type Dimensions ¶
type ReportItem ¶
type ReportItem struct {
MetricName string `json:"metricName"`
MetricValue string `json:"value"`
Dimensions Dimensions `json:"dimensions"`
DimensionsOrder []string `json:"-"`
Unit string `json:"unit"`
Timestamp string `json:"timestamp"`
}
func (*ReportItem) Serialize ¶
func (p *ReportItem) Serialize() string
Click to show internal directories.
Click to hide internal directories.