Skip to content

Commit

Permalink
Timing info and updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenGround0 committed Mar 6, 2023
1 parent 5534755 commit a2d3315
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
Binary file modified build/openrpc/full.json.gz
Binary file not shown.
14 changes: 12 additions & 2 deletions cli/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,7 @@ var ChainPruneCmd = &cli.Command{
Subcommands: []*cli.Command{
chainPruneColdCmd,
chainPruneHotGCCmd,
chainPruneHotMovingGCCmd,
},
}

Expand All @@ -1616,7 +1617,11 @@ var chainPruneHotGCCmd = &cli.Command{
opts.Periodic = cctx.Bool("periodic")
opts.Threshold = cctx.Float64("threshold")

return api.ChainHotGC(ctx, opts)
gcStart := time.Now()
err = api.ChainHotGC(ctx, opts)
gcTime := time.Since(gcStart)
fmt.Printf("Online GC took %v (periodic <%t> threshold <%f>)", gcTime, opts.Periodic, opts.Threshold)
return err
},
}

Expand All @@ -1632,7 +1637,12 @@ var chainPruneHotMovingGCCmd = &cli.Command{
ctx := ReqContext(cctx)
opts := lapi.HotGCOpts{}
opts.Moving = true
return api.ChainHotGC(ctx, opts)

gcStart := time.Now()
err = api.ChainHotGC(ctx, opts)
gcTime := time.Since(gcStart)
fmt.Printf("Moving GC took %v", gcTime)
return err
},
}

Expand Down
3 changes: 2 additions & 1 deletion documentation/en/api-v1-unstable-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,8 @@ Inputs:
[
{
"Threshold": 12.3,
"Periodic": true
"Periodic": true,
"Moving": true
}
]
```
Expand Down
14 changes: 14 additions & 0 deletions documentation/en/cli-lotus.md
Original file line number Diff line number Diff line change
Expand Up @@ -2473,6 +2473,7 @@ USAGE:
COMMANDS:
compact-cold force splitstore compaction on cold store state and run gc
hot run online (badger vlog) garbage collection on hotstore
hot-moving run moving gc on hotstore
help, h Shows a list of commands or help for one command
OPTIONS:
Expand Down Expand Up @@ -2509,6 +2510,19 @@ OPTIONS:
```

#### lotus chain prune hot-moving
```
NAME:
lotus chain prune hot-moving - run moving gc on hotstore
USAGE:
lotus chain prune hot-moving [command options] [arguments...]
OPTIONS:
--help, -h show help (default: false)
```

## lotus log
```
NAME:
Expand Down

0 comments on commit a2d3315

Please sign in to comment.