log_event

package
v0.0.0-...-07ef6c8 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Artistic-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NameMap = map[string]string{
	"http://api.wxxsxx.com/sms/heartBeat":                "v4平台",
	"http://csms.wxxsxx.com/sms/heartBeat":               "csms平台",
	"http://east.wxxsxx.com/sms/heartBeat":               "east平台",
	"http://ems.wxxsxx.com:8080/websms/smsJsonService":   "ems平台",
	"http://north.wxxsxx.com/sms/heartBeat":              "north平台",
	"http://south.wxxsxx.com/sms/heartBeat":              "south平台)",
	"https://sms.hechensc.cn/callback":                   "山水平台",
	"https://wxsms-sh.wxxsxx.com/websms/smsJsonService":  "上海v4",
	"http://tc-sz.wxxsxx.com:8082/websms/smsJsonService": "腾讯苏州",
	"http://tc-wx.wxxsxx.com:8082/websms/smsJsonService": "腾讯无锡",
	"ecs-3683":    "华为云贵州ecs",
	"aliyun-sh-1": "阿里云上海ecs",
}

Functions

func UpdateSlas

func UpdateSlas(slas []*Sla, url string, host string, createds []time.Time)

Types

type MonitorLogEvent

type MonitorLogEvent struct {
	Level   string    `json:"level"`
	Time    string    `json:"time"`
	Msg     string    `json:"msg"`
	Created time.Time `json:"created"`
	Url     string    `json:"url"`
	Host    string    `json:"host"`
	Fail    uint8     `json:"fail"`
	Error   string    `json:"error"`
	Elapsed uint16    `json:"elapsed"`
	Status  uint16    `json:"status"`
}

{"level":"info", "time":"2022-03-10T12:09:15.063+0800", "msg":"monitor result", "created":"2022-03-10 12:09:11", "url":"http://api.wxxsxx.com/sms/heartBeat", "host":"ecs-3683", "fail":0, "error":"", "elapsed":26, "status_code":200}

func (*MonitorLogEvent) TableName

func (m *MonitorLogEvent) TableName() string

type Sla

type Sla struct {
	Url           string  `json:"url"`
	Host          string  `json:"host"`
	MinElapsed    float64 `json:"max_elapsed"`
	MaxElapsed    float64 `json:"max_elapsed"`
	AvgElapsed    float64 `json:"average"`
	MedianElapsed float64 `json:"median"`
	P90Elapsed    float64 `json:"line90"` //`gorm:"column:name"`
	P95Elapsed    float64 `json:"line95"`
	P99Elapsed    float64 `json:"line99"`
	P999Elapsed   float64 `json:"line999"`
	AllCount      int64   `json:"count"`
	Sum           int64   `json:"sum"`
	SuccRate      string  `json:"success_rate_string"`
	//多个键值对之间要用空格隔开!!
	Timeouts []string `json:"timeout_times" gorm:"column:timeouts,type:time"`
}

type SlaData

type SlaData struct {
	StartDate string `json:"start_date"`
	EndDate   string `json:"end_date"`
	Result    []*Sla `json:result`
}

Jump to

Keyboard shortcuts

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