Documentation ¶
Index ¶
- type ErrorInfo
- type HideReaddirFS
- type HttpCodeInfo
- type ItemContext
- func (ctx *ItemContext) Exists(key string) bool
- func (ctx *ItemContext) Get(key string) (value interface{}, exists bool)
- func (ctx *ItemContext) GetCurrentMap() map[string]interface{}
- func (ctx *ItemContext) GetInt(key string) int
- func (ctx *ItemContext) GetString(key string) string
- func (ctx *ItemContext) GetUInt64(key string) uint64
- func (ctx *ItemContext) Len() int
- func (ctx *ItemContext) Once(key string) (value interface{}, exists bool)
- func (ctx *ItemContext) Remove(key string)
- func (ctx *ItemContext) Set(key string, value interface{}) error
- type RequestInfo
- type ServerStateInfo
- func (state *ServerStateInfo) AddErrorCount(page string, err error, num uint64) uint64
- func (state *ServerStateInfo) AddRequestCount(page string, code int, num uint64) uint64
- func (state *ServerStateInfo) QueryIntervalErrorData(queryKey string) uint64
- func (state *ServerStateInfo) QueryIntervalRequestData(queryKey string) uint64
- func (state *ServerStateInfo) ShowHtmlData() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HideReaddirFS ¶
type HideReaddirFS struct {
FileSystem http.FileSystem
}
FileSystem with hide Readdir
type ItemContext ¶
自带锁,并发安全的Map
func NewItemContext ¶
func NewItemContext() *ItemContext
func (*ItemContext) Get ¶
func (ctx *ItemContext) Get(key string) (value interface{}, exists bool)
* 读取指定key在AppContext中的内容
func (*ItemContext) GetCurrentMap ¶
func (ctx *ItemContext) GetCurrentMap() map[string]interface{}
get current map, returns map[string]interface{}
func (*ItemContext) GetInt ¶
func (ctx *ItemContext) GetInt(key string) int
* 读取指定key在AppContext中的内容,以int格式输出
func (*ItemContext) GetString ¶
func (ctx *ItemContext) GetString(key string) string
* 读取指定key在AppContext中的内容,以string格式输出
func (*ItemContext) GetUInt64 ¶
func (ctx *ItemContext) GetUInt64(key string) uint64
* 读取指定key在AppContext中的内容,以int格式输出
func (*ItemContext) Once ¶
func (ctx *ItemContext) Once(key string) (value interface{}, exists bool)
get item by gived key, and remove it only can be read once, it will be locked
func (*ItemContext) Remove ¶
func (ctx *ItemContext) Remove(key string)
remove item by gived key if not exists key, do nothing...
func (*ItemContext) Set ¶
func (ctx *ItemContext) Set(key string, value interface{}) error
* 以key、value置入AppContext
type RequestInfo ¶
http request count info
type ServerStateInfo ¶
type ServerStateInfo struct { //服务启动时间 ServerStartTime time.Time //是否启用详细请求数据统计 fixed #63 状态数据,当url较多时,导致内存占用过大 EnabledDetailRequestData bool //该运行期间总访问次数 TotalRequestCount uint64 //单位时间内请求数据 - 按分钟为单位 IntervalRequestData *ItemContext //明细请求页面数据 - 以不带参数的访问url为key DetailRequestURLData *ItemContext //该运行期间异常次数 TotalErrorCount uint64 //单位时间内异常次数 - 按分钟为单位 IntervalErrorData *ItemContext //明细异常页面数据 - 以不带参数的访问url为key DetailErrorPageData *ItemContext //明细异常数据 - 以不带参数的访问url为key DetailErrorData *ItemContext //明细Http状态码数据 - 以HttpCode为key,例如200、500等 DetailHTTPCodeData *ItemContext // contains filtered or unexported fields }
服务器状态信息
var GlobalState *ServerStateInfo
func (*ServerStateInfo) AddErrorCount ¶
func (state *ServerStateInfo) AddErrorCount(page string, err error, num uint64) uint64
AddErrorCount 增加错误数
func (*ServerStateInfo) AddRequestCount ¶
func (state *ServerStateInfo) AddRequestCount(page string, code int, num uint64) uint64
AddRequestCount 增加请求数
func (*ServerStateInfo) QueryIntervalErrorData ¶
func (state *ServerStateInfo) QueryIntervalErrorData(queryKey string) uint64
QueryIntervalErrorData query error count by query time
func (*ServerStateInfo) QueryIntervalRequestData ¶
func (state *ServerStateInfo) QueryIntervalRequestData(queryKey string) uint64
QueryIntervalRequestData query request count by query time
func (*ServerStateInfo) ShowHtmlData ¶
func (state *ServerStateInfo) ShowHtmlData() string
ShowHtmlData show server state data html-string format
Click to show internal directories.
Click to hide internal directories.