Documentation ¶
Index ¶
- func GetLocalIPs() ([]string, error)
- func GetMysqlConnectionInfo(user string, password string, port uint16) (map[string]*DBConnectionInfo, error)
- func Hash(key string) string
- func ReadLengthEncodedInteger(b []byte) (uint64, bool, int)
- func ReadStatus(b []byte) uint16
- type ConnectionWatcher
- type DBConnectionInfo
- type QuantileGroup
- type RollingNumber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMysqlConnectionInfo ¶
func GetMysqlConnectionInfo(user string, password string, port uint16) (map[string]*DBConnectionInfo, error)
GetMysqlConnectionInfo return all db connection info
func ReadLengthEncodedInteger ¶
ReadLengthEncodedInteger is a length decoder
Types ¶
type ConnectionWatcher ¶
ConnectionWatcher get the connection info by db client and refresh periodically
func NewConnectionWatcher ¶
func NewConnectionWatcher(uname, passward string, port uint16) *ConnectionWatcher
NewConnectionWatcher create a instance of connection watcher
func (*ConnectionWatcher) Get ¶
func (w *ConnectionWatcher) Get(key string) *DBConnectionInfo
Get return the connection info by key
type DBConnectionInfo ¶
type DBConnectionInfo struct {
ID, User, Host, DB, Cmd, Time, State, Info, Sent, Examined []byte
}
DBConnectionInfo retrieves the db connection info
type QuantileGroup ¶
QuantileGroup caculate the 99 quantile, min and max
func NewQuantileGroup ¶
func NewQuantileGroup(expiration time.Duration, size int) *QuantileGroup
NewQuantileGroup create a QuantileGroup
func (*QuantileGroup) Add ¶
func (g *QuantileGroup) Add(key string, value int64)
Add record one point
type RollingNumber ¶
type RollingNumber struct {
// contains filtered or unexported fields
}
RollingNumber is struct for statistics
func NewRollingNumber ¶
func NewRollingNumber(timeInMilliseconds, numberOfBuckets int64) (*RollingNumber, error)
NewRollingNumber create a new rolling number
func (*RollingNumber) Add ¶
func (n *RollingNumber) Add(key string, val int64)
Add increase the counter specified by key with val
func (*RollingNumber) AverageInSecond ¶
func (n *RollingNumber) AverageInSecond(key string) int64
AverageInSecond caculate the average of the item specified by key in second
func (*RollingNumber) Sum ¶
func (n *RollingNumber) Sum(key string) int64
Sum return the sum of the counter sepecified by key