Skip to content

Commit

Permalink
remove no-collect-pprof and no-collect-log flag
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro committed Oct 14, 2022
1 parent 6863476 commit 77f6ef1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 37 deletions.
24 changes: 5 additions & 19 deletions cmd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,17 @@ $ juicefs debug --out-dir=/var/log /mnt/jfs
# Get the last up to 1000 log entries
$ juicefs debug --out-dir=/var/log --limit=1000 /mnt/jfs
# Don't collect pprof information
$ juicefs debug --out-dir=/var/log --no-collect-pprof --limit=1000 /mnt/jfs
`,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "out-dir",
Value: defaultOutDir,
Usage: "the output directory of the result file",
},
&cli.BoolFlag{
Name: "no-collect-log",
Usage: "do not collect log",
},
&cli.Uint64Flag{
Name: "limit",
Usage: "the number of last entries to be collected",
},
&cli.BoolFlag{
Name: "no-collect-pprof",
Usage: "do not collect pprof",
},
&cli.Uint64Flag{
Name: "stats-sec",
Value: 5,
Expand Down Expand Up @@ -554,17 +543,14 @@ func debug(ctx *cli.Context) error {
return err
}

if !ctx.Bool("no-collect-log") {
if err := collectLog(ctx, cmd, rootPrivileges, currDir); err != nil {
return err
}
if err := collectLog(ctx, cmd, rootPrivileges, currDir); err != nil {
return err
}

if !ctx.Bool("no-collect-pprof") {
if err := collectPprof(ctx, cmd, pid, amp, rootPrivileges, currDir, &wg); err != nil {
return err
}
if err := collectPprof(ctx, cmd, pid, amp, rootPrivileges, currDir, &wg); err != nil {
return err
}

wg.Wait()
return geneZipFile(currDir, filepath.Join(outDir, fmt.Sprintf("%s-%s.zip", prefix, timestamp)))
}
9 changes: 0 additions & 9 deletions docs/en/reference/command_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1217,15 +1217,9 @@ The output directory of the results, automatically created if the directory does
`--stats-sec value`<br />
The number of seconds to sample .stats file (default: 5)

`--no-collect-log`<br />
do not collect log (default: false)

`--limit value`<br />
The number of log entries collected, from newest to oldest, if not specified, all entries will be collected

`--no-collect-pprof`<br />
do not collect pprof metrics (default: false)

`--trace-sec value`<br />
The number of seconds to sample trace metrics (default: 5)

Expand All @@ -1243,7 +1237,4 @@ $ juicefs debug --out-dir=/var/log /mnt/jfs

# Get the last up to 1000 log entries
$ juicefs debug --out-dir=/var/log --limit=1000 /mnt/jfs

# Don't collect pprof information
$ juicefs debug --out-dir=/var/log --no-collect-pprof --limit=1000 /mnt/jfs
```
9 changes: 0 additions & 9 deletions docs/zh_cn/reference/command_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1220,15 +1220,9 @@ juicefs debug [command options] MOUNTPOINT
`--stats-sec value`<br />
.stats文件采样秒数 (默认:5)

`--no-collect-log`<br />
不收集日志 (默认:false)

`--limit value`<br />
收集的日志条目数,从新到旧,若不指定则收集全部条目

`--no-collect-pprof`<br />
不收集 pprof 指标 (默认:false)

`--trace-sec value`<br />
trace指标采样秒数 (默认:5)

Expand All @@ -1246,7 +1240,4 @@ $ juicefs debug --out-dir=/var/log /mnt/jfs

# 收集最后 1000 条日志条目
$ juicefs debug --out-dir=/var/log --limit=1000 /mnt/jfs

# 不收集 pprof 指标
$ juicefs debug --out-dir=/var/log --no-collect-pprof --limit=1000 /mnt/jfs
```

0 comments on commit 77f6ef1

Please sign in to comment.