Documentation
¶
Overview ¶
This code is mostly copied from Beego BeeMap
Index ¶
- func Decode(c *cli.Context, decoder *decoder.Decoder, filepath string)
- func Dump(path string) (map[string]interface{}, error)
- func Export_All_keys(cli *cli.Context)
- func GetData(filename string, cnt *Counter) map[string]interface{}
- func InitHTMLTmpl()
- func Key(key string) string
- func ServeHTML(w http.ResponseWriter, layout string, content string, ...)
- func Show(c *cli.Context)
- func Slot(key string) int
- func ToCliWriter(cli *cli.Context)
- func ToCliWriterToFile(cli *cli.Context)
- type Counter
- type PrefixEntry
- type SafeMap
- type SlotEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Export_All_keys ¶ added in v1.1.0
keys is function for command `keys` output all keys in rdb file(s) get from args
func InitHTMLTmpl ¶
func InitHTMLTmpl()
func ServeHTML ¶
func ServeHTML(w http.ResponseWriter, layout string, content string, data map[string]interface{})
ServeHTML generate and write html to client
func ToCliWriter ¶
ToCliWriter dump rdb file statistical information to STDOUT.
func ToCliWriterToFile ¶ added in v1.0.6
ToCliWriter dump rdb file statistical information to file.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter for redis memory usage
func (*Counter) Count ¶
Count by various dimensions,show.go NewCounter 后,调用此方法,遍历decoder的entry, <-chan表示一个只能接收数据的单向通道
func (*Counter) GetLargestEntries ¶
GetLargestEntries from heap, num max is 500
func (*Counter) GetLargestKeyPrefixes ¶
func (c *Counter) GetLargestKeyPrefixes() []*PrefixEntry
GetLargestKeyPrefixes from heap
func (*Counter) GetLenLevelCount ¶
func (c *Counter) GetLenLevelCount() []*PrefixEntry
GetLenLevelCount from map
type PrefixEntry ¶
type PrefixEntry struct {
Bytes uint64
Num uint64
Db string //之前为int
// contains filtered or unexported fields
}
PrefixEntry record value by prefix
type SafeMap ¶
type SafeMap struct {
// contains filtered or unexported fields
}
SafeMap is a map which concurrency safe
func (*SafeMap) Get ¶
func (m *SafeMap) Get(k interface{}) interface{}
Get from maps return the k's value
func (*SafeMap) Items ¶
func (m *SafeMap) Items() map[interface{}]interface{}
Items returns all items in safemap.