Skip to content

Commit

Permalink
update help
Browse files Browse the repository at this point in the history
  • Loading branch information
HDT3213 committed Mar 28, 2022
1 parent e1f5e86 commit 7ca4664
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
# Dependency directories (remove the comment below to include it)
# vendor/
.idea
target
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o target/rdb-linux-amd64 ./
go build -o target/rdb-darwin ./
7 changes: 4 additions & 3 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@ This is a tool to parse Redis' RDB files
Options:
-c command, including: json/memory/aof
-o output file path
-n number of result
-n number of result, using in
-port listen port for flame graph web service
-sep separator for flamegraph, rdb will separate key by it, default value is ":".
supporting multi separators: -sep sep1 -sep sep2
Examples:
parameters between '[' and ']' is optional
1. convert rdb to json
rdb -c json -o dump.json dump.rdb
2. generate memory report
rdb -c memory -o memory.csv dump.rdb
3. convert to aof file
rdb -c aof -o dump.aof dump.rdb
4. get largest keys
rdb -c bigkey -o dump.aof dump.rdb
rdb -c bigkey [-o dump.aof] [-n 10] dump.rdb
5. draw flamegraph
rdb -c flamegraph -port 16379 -sep : dump.rdb
rdb -c flamegraph [-port 16379] [-sep :] dump.rdb
`

type separators []string
Expand Down
3 changes: 3 additions & 0 deletions core/zset.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ func (dec *Decoder) readZSet(zset2 bool) ([]*model.ZSetEntry, error) {
} else {
score, err = dec.readLiteralFloat()
}
if err != nil {
return nil, err
}
entries = append(entries, &model.ZSetEntry{
Member: string(member),
Score: score,
Expand Down

0 comments on commit 7ca4664

Please sign in to comment.