Skip to content

Commit

Permalink
DAOS-14422 control: Update pool query UX for MD-on-SSD phase2
Browse files Browse the repository at this point in the history
Required-githooks: true

Signed-off-by: Tom Nabarro <[email protected]>
  • Loading branch information
tanabarr committed Jul 30, 2024
1 parent 5efe997 commit 6992000
Show file tree
Hide file tree
Showing 8 changed files with 353 additions and 444 deletions.
6 changes: 3 additions & 3 deletions src/control/cmd/daos/pretty/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func printPoolTiers(suss []*daos.StorageUsageStats, w *txtfmt.ErrWriter, fullSta
// Meta-blob aggregate size.
if fullStats {
fmt.Fprintf(w, "- Total memory-file size: %s\n",
humanize.Bytes(tierStats.Total))
humanize.Bytes(memFileBytes))
}
fmt.Fprintf(w, "- Metadata storage:\n")
mdOnSSD = true
Expand Down Expand Up @@ -93,7 +93,7 @@ func PrintPoolInfo(pi *daos.PoolInfo, out io.Writer) error {
if pi.QueryMask.HasOption(daos.PoolQueryOptionSpace) && pi.TierStats != nil {
fmt.Fprintln(w, "Pool space info:")
fmt.Fprintf(w, "- Target count:%d\n", pi.ActiveTargets)
printPoolTiers(pi.TierStats, w, true)
printPoolTiers(pi.MemFileBytes, pi.TierStats, w, true)
}
return w.Err
}
Expand All @@ -109,7 +109,7 @@ func PrintPoolQueryTargetInfo(pqti *daos.PoolQueryTargetInfo, out io.Writer) err
// Maintain output compatibility with the `daos pool query-targets` output.
fmt.Fprintf(w, "Target: type %s, state %s\n", pqti.Type, pqti.State)
if pqti.Space != nil {
printPoolTiers(pqti.Space, w, false)
printPoolTiers(pqti.MemFileBytes, pqti.Space, w, false)
}

return w.Err
Expand Down
4 changes: 2 additions & 2 deletions src/control/cmd/dmg/pretty/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func printTierBytesRow(fmtName string, tierBytes uint64, numRanks int) txtfmt.Ta
}
}

func getPoolRespStorageRows(mdOnSSD bool, tierBytes []uint64, tierRatios []float64, numRanks int) (title string, rows []txtfmt.TableRow) {
func getPoolCreateRespRows(mdOnSSD bool, tierBytes []uint64, tierRatios []float64, numRanks int) (title string, rows []txtfmt.TableRow) {
title = "Pool created with "
tierName := "SCM"
if mdOnSSD {
Expand Down Expand Up @@ -125,7 +125,7 @@ func PrintPoolCreateResponse(pcr *control.PoolCreateResp, out io.Writer, opts ..
"Total Size": humanize.Bytes(totalSize * uint64(numRanks)),
})

title, tierRows := getPoolRespStorageRows(pcr.MemFileBytes != 0, pcr.TierBytes, tierRatios,
title, tierRows := getPoolCreateRespRows(pcr.MemFileBytes != 0, pcr.TierBytes, tierRatios,
numRanks)
fmtArgs = append(fmtArgs, tierRows...)

Expand Down
215 changes: 118 additions & 97 deletions src/control/common/proto/mgmt/pool.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/control/lib/control/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ type (
SvcReps []uint32 `json:"svc_reps"`
TgtRanks []uint32 `json:"tgt_ranks"`
TierBytes []uint64 `json:"tier_bytes"` // Per-rank storage tier sizes.
MemFileBytes uint64 `json:"mem_file_bytes"` // MD-on-SSD mode only.
MemFileBytes uint64 `json:"mem_file_bytes"` // Per-rank. MD-on-SSD mode only.
}
)

Expand Down
8 changes: 5 additions & 3 deletions src/control/lib/daos/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,18 @@ type (
DisabledRanks *ranklist.RankSet `json:"-"`
PoolLayoutVer uint32 `json:"pool_layout_ver"`
UpgradeLayoutVer uint32 `json:"upgrade_layout_ver"`
MemFileBytes uint64 `json:"mem_file_bytes"`
}

PoolQueryTargetType int32
PoolQueryTargetState int32

// PoolQueryTargetInfo contains information about a single target
PoolQueryTargetInfo struct {
Type PoolQueryTargetType `json:"target_type"`
State PoolQueryTargetState `json:"target_state"`
Space []*StorageUsageStats `json:"space"`
Type PoolQueryTargetType `json:"target_type"`
State PoolQueryTargetState `json:"target_state"`
Space []*StorageUsageStats `json:"space"`
MemFileBytes uint64 `json:"mem_file_bytes"`
}

// StorageTargetUsage represents DAOS target storage usage
Expand Down
Loading

0 comments on commit 6992000

Please sign in to comment.