Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🔎 redis memory analyzer for golang

License

NotificationsYou must be signed in to change notification settings

winjeg/rma4go

Repository files navigation

CircleCIGithubWorkflowGolangCIcodecovMit LicenseMinVerGoproxy.cn

rma4go (redis memory analyzer for golang) is a online redis memory analyzer.It's light and easy to use, and prints out a pretty markdown table

functionality

rma4go provide statistics for redis in many dimensions, the mainly supported dimensions are listed below

  1. key size, data size statistics
  2. key expire statistics
  3. big key statistics
  4. different types of key statistics

usage

how to use in your code

go get github.com/winjeg/rma4go
functestFunc() {h:="localhost"a:=""p:=6379cli:=client.BuildRedisClient(client.ConnInfo{Host:h,Auth:a,Port:p,},cmder.GetDb())stat:=analyzer.ScanAllKeys(cli)// print in command linestat.Print()// the object is ready to use}

how to build

before build

  1. make sure your go version >= 1.11.0
  2. make sure you have internet access and can access google.com
git clone git@github.com:winjeg/rma4go.gitcd rma4gogo build.

command line usage

usage is quite simple, it prints out a table in command line in markdown format

rma4go usage:standalone:  rma4go -r some_host -p 6379 -a password -d 0cluster:    rma4go -c "localhost:123,localhost:124,localhost:1234" -a "password"======================================================  -h help content  -H string    address of a redis (default "localhost")  -a string    password/auth of the redis  -d int    db of the redis to analyze  -p int    port of the redis (default 6379)  -r string    address of a redis (default "localhost")  -m match a pattern to scan

sample output

rendered by markdowntotal count 4004

all keys statistics

PATTERNKEY NUMKEY SIZEDATA SIZEEXPIRE IN HOUREXPIRE IN DAYEXPIRE IN WEEKEXPIRE OUT WEEKNEVER EXPIRE
TOP_TEN_NEW_XXXXXXXX*120152900001
XXXXXXXXXXXXXX_STATISTICS_MIGRATION_LIST*140769283200001
time-root:*23272299000023
DS_AXXXXXXXX_CORRECT*2454600002
time-2*761752898930000761
time-level:*537846169810000537
time-9*10290113260000102
time-7*153137219890000153
DS_MAGIC_SUCC_2017-06-22*12441500001
tersssss*5124000005
appoint_abcdefg_msgid*121000001
BUSSINESSXXXXXXX_STATISTICS_NEED_CALC_RECENT*144100001
switch_abcd_abcde*369300003
abcdeferCounter_201*378000003
diy1234567flag*114100001
DS_PRXXBCD_LIST*1151720800001
time-4*133119417290000133
datastatistics_switch_version0*130100001
register_count_2_201*592159846400000592
canVisitNewabcdef1234PageLevels*131000001
YOUR_WEEK_VITALITY_INFO*1237578200001
time-8*10189413130000101
EXPERTS_APPOINT_INFO_MAP*124000001
time-3*130121516900000130
time-1*9439456122590000943
time-64*877811131000087
time-5*168151621840000168
total400453422783249000004004

string keys statistics

PATTERNKEY NUMKEY SIZEDATA SIZEEXPIRE IN HOUREXPIRE IN DAYEXPIRE IN WEEKEXPIRE OUT WEEKNEVER EXPIRE
BUSSINESSXXXXXXX_STATISTICS_NEED_CALC_RECENT*144100001
time-5*130117416900000130
datastatistics_switch_version0*130100001
time-7*39348507000039
time-level:*567893973710000567
diy1234567flag*114100001
switch_abcd_abcde*369300003
time-2*598591877740000598
time-6*125111816250000125
time-4*136122517680000136
time-8*72636936000072
time-1*1176118141528800001176
time-9*10088013000000100
time-root:*23272299000023
register_count_2_201*592159846400000592
DS_AXXXXXXXX_CORRECT*1202000001
TOP_TEN_NEW_tersssss*120152900001
time-3*202192526260000202
total3989530424625300003989

list keys statistics

PATTERNKEY NUMKEY SIZEDATA SIZEEXPIRE IN HOUREXPIRE IN DAYEXPIRE IN WEEKEXPIRE OUT WEEKNEVER EXPIRE
XXXXXXXXXXXXXX_STATISTICS_MIGRATION_LIST*140769283200001
DS_MAGIC_SUCC_2017-06-22*12441500001
DS_PRXXBCD_LIST*1151720800001
total379771045500003

hash keys statistics

PATTERNKEY NUMKEY SIZEDATA SIZEEXPIRE IN HOUREXPIRE IN DAYEXPIRE IN WEEKEXPIRE OUT WEEKNEVER EXPIRE
tersssss_action_prepage_new*127000001
YOUR_WEEK_VITALITY_INFO*1237578200001
EXPERTS_APPOINT_INFO_MAP*124000001
abcdeferCounter_2017-06-11*126000001
tersssssHardTaskCounter*123000001
abcdeferCounter_2018-04-27*126000001
abcdeferCounter_2017-09-01*126000001
tersssssEasyTaskCounter*123000001
total81987578200008

set keys statistics

PATTERNKEY NUMKEY SIZEDATA SIZEEXPIRE IN HOUREXPIRE IN DAYEXPIRE IN WEEKEXPIRE OUT WEEKNEVER EXPIRE
tersssss_bind_phone_phone*125000001
appoint_abcdefg_msgid*121000001
canVisitNewabcdef1234PageLevels*131000001
tersssss_bind_phone_userid*126000001
total4103000004

zset keys statistics

PATTERNKEY NUMKEY SIZEDATA SIZEEXPIRE IN HOUREXPIRE IN DAYEXPIRE IN WEEKEXPIRE OUT WEEKNEVER EXPIRE
total00000000
other keys statistics
PATTERNKEY NUMKEY SIZEDATA SIZEEXPIRE IN HOUREXPIRE IN DAYEXPIRE IN WEEKEXPIRE OUT WEEKNEVER EXPIRE
total00000000

big keys statistics

PATTERNKEY NUMKEY SIZEDATA SIZEEXPIRE IN HOUREXPIRE IN DAYEXPIRE IN WEEKEXPIRE OUT WEEKNEVER EXPIRE
XXXXXXXXXXXXXX_STATISTICS_MIGRATION_LIST*140769283200001
total140769283200001

maintain

  1. welcome to contribute to this repo
  2. welcome to submit issues for this repo
  3. if you have any questions, feel free to ask

About

🔎 redis memory analyzer for golang

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp