Created
October 22, 2019 18:47
-
-
Save hto/3ff1e9f84163f9622f0a5b50801d53ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
. "github.com/hto/redis-memory-analysis" | |
) | |
var ( | |
host = flag.String("host", "127.0.0.1", "The host of redis") | |
port = flag.String("port", "6379", "The port of redis") | |
password = flag.String("password", "", "The password of redis") | |
reportPath = flag.String("reportPath", "./reports", "The csv file path of analysis result") | |
) | |
func main() { | |
flag.Parse() | |
// ElastiCache Endpoint | |
Connection(*host, *port, *password) | |
// sorted by key priority | |
Start([]string{":", "_"}) | |
// //Find the csv file in default target folder: ./reports | |
// //CSV file name format: redis-analysis-{host:port}-{db}.csv | |
// //The keys order by count desc | |
err := SaveReports(*reportPath) | |
if err == nil { | |
fmt.Println("\ndone") | |
} else { | |
fmt.Println("error:", err) | |
} | |
Close() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment