14 Star 47 Fork 10

Xie Biao / go-redis-memory-analysis

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
analysis_interface.go 829 Bytes
一键复制 编辑 原始数据 按行查看 历史
XieBiao 提交于 2018-04-24 14:08 . make interface
package gorma
type AnalysisInterface interface {
Start(delimiters []string)
SaveReports(folder string) error
Close()
}
type Report struct {
Key string
Count uint64
Size uint64
NeverExpire uint64
AvgTtl uint64
}
type DBReports map[uint64][]Report
type KeyReports map[string]Report
type SortBySizeReports []Report
type SortByCountReports []Report
func (sr SortBySizeReports) Len() int {
return len(sr)
}
func (sr SortBySizeReports) Less(i, j int) bool {
return sr[i].Size > sr[j].Size
}
func (sr SortBySizeReports) Swap(i, j int) {
sr[i], sr[j] = sr[j], sr[i]
}
func (sr SortByCountReports) Len() int {
return len(sr)
}
func (sr SortByCountReports) Less(i, j int) bool {
return sr[i].Count > sr[j].Count
}
func (sr SortByCountReports) Swap(i, j int) {
sr[i], sr[j] = sr[j], sr[i]
}
Go
1
https://gitee.com/hhxsv5/go-redis-memory-analysis.git
git@gitee.com:hhxsv5/go-redis-memory-analysis.git
hhxsv5
go-redis-memory-analysis
go-redis-memory-analysis
master

搜索帮助