Skip to content

Commit ccaab50

Browse files
author
XieBiao
committed
add some notices for console
1 parent 2700a2e commit ccaab50

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Redis memory analysis
1010
2. Run
1111

1212
```Shell
13+
# help
1314
./redis-memory-analysis-linux-amd64 -h
1415
Usage of ./redis-memory-analysis-darwin-amd64:
1516
-ip string
@@ -22,6 +23,9 @@ Usage of ./redis-memory-analysis-darwin-amd64:
2223
The prefixes list of redis key, be split by ',', special pattern characters need to escape by '\' (default "#,:")
2324
-reportPath string
2425
The csv file path of analysis result (default "./reports")
26+
27+
# run
28+
./redis-memory-analysis-linux-amd64 -ip="127.0.0.1" -port=6380 -password="abc"
2529
```
2630

2731
## Source Code Usage

analysis.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (analysis *Analysis) Close() {
6060
}
6161

6262
func (analysis Analysis) Start(delimiters []string) {
63-
63+
fmt.Println("Starting analysis")
6464
match := "*[" + strings.Join(delimiters, "") + "]*"
6565
databases, _ := analysis.redis.GetDatabases()
6666

@@ -75,6 +75,7 @@ func (analysis Analysis) Start(delimiters []string) {
7575
)
7676

7777
for db, _ := range databases {
78+
fmt.Println("Analyzing db", db)
7879
cursor = 0
7980
mr = KeyReports{}
8081

@@ -142,6 +143,7 @@ func (analysis Analysis) Start(delimiters []string) {
142143
}
143144

144145
func (analysis Analysis) SaveReports(folder string) error {
146+
fmt.Println("Saving the results of the analysis into", folder)
145147
if _, err := os.Stat(folder); os.IsNotExist(err) {
146148
os.MkdirAll(folder, os.ModePerm)
147149
}

examples/build.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ func main() {
2727
analysis.Start(strings.Split(*prefixes, ","))
2828

2929
analysis.SaveReports(*reportPath)
30+
31+
fmt.Println("Done")
3032
}

examples/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ func main() {
2323
//CSV file name format: redis-analysis-{host:port}-{db}.csv
2424
//The keys order by count desc
2525
analysis.SaveReports("./reports")
26+
27+
fmt.Println("Done")
2628
}

0 commit comments

Comments
 (0)