Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: changelog for dag stat #9919

Merged
merged 2 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion core/commands/dag/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func dagStat(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment)
DAG: nodeGetter,
Order: traverse.DFSPre,
Func: func(current traverse.State) error {
fmt.Println("previousDagStatSize:", dagstats.Size)
currentNodeSize := uint64(len(current.Node.RawData()))
dagstats.Size += currentNodeSize
dagstats.NumBlocks++
Expand Down
22 changes: 22 additions & 0 deletions docs/changelogs/v0.21.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [`client/rpc` migration of `go-ipfs-http-client`](#clientrpc-migration-of-go-ipfs-http-client)
- [Gateway: DAG-CBOR/-JSON previews and improved error pages](#gateway-dag-cbor-json-previews-and-improved-error-pages)
- [Gateway: subdomain redirects are now `text/html`](#gateway-subdomain-redirects-are-now-texthtml)
- [`ipfs dag stat` deduping statistics](#ipfs-dag-stat-deduping-statistics)
- [📝 Changelog](#-changelog)
- [👨‍👩‍👧‍👦 Contributors](#-contributors)

Expand Down Expand Up @@ -102,6 +103,27 @@ $ curl "https://subdomain-gw.example.net/ipfs/${cid}/"

Rationale can be found in [kubo#9913](https://github.com/ipfs/kubo/pull/9913).

#### `ipfs dag stat` deduping statistics

`ipfs dat stat` now accept multiple CIDs and will dump advanced statistics
on the number of shared blocks and size of each CID.

```console
$ ipfs dag stat --progress=false QmfXuRxzyVy5H2LssLgtXrKCrNvDY8UBvMp2aoW8LS8AYA QmfZDyu2UFfUhL4VdHaw7Hofivmn5D4DdQj38Lwo86RsnB

CID Blocks Size
QmfXuRxzyVy5H2LssLgtXrKCrNvDY8UBvMp2aoW8LS8AYA 3 2151
QmfZDyu2UFfUhL4VdHaw7Hofivmn5D4DdQj38Lwo86RsnB 4 3223

Summary
Total Size: 3326
Unique Blocks: 5
Shared Size: 2048
Ratio: 1.615755
```

`ipfs --enc=json dag stat`'s keys are a non breaking change, new keys have been added but old keys with previous sementics are still here.

### 📝 Changelog

### 👨‍👩‍👧‍👦 Contributors