storagenode/console: API /dashboard disk-space data separated for UsedForPieces, Trash, Available
Change-Id: I7411da2c92c72a24af98e007efe476d8a023db82
This commit is contained in:
parent
16081f53d2
commit
7a83473f00
@ -7,4 +7,5 @@ package console
|
||||
type DiskSpaceInfo struct {
|
||||
Used int64 `json:"used"`
|
||||
Available int64 `json:"available"`
|
||||
Trash int64 `json:"trash"`
|
||||
}
|
||||
|
@ -167,7 +167,12 @@ func (s *Service) GetDashboardData(ctx context.Context) (_ *Dashboard, err error
|
||||
)
|
||||
}
|
||||
|
||||
piecesContentSize, err := s.pieceStore.SpaceUsedForPiecesAndTrash(ctx)
|
||||
_, piecesContentSize, err := s.pieceStore.SpaceUsedForPieces(ctx)
|
||||
if err != nil {
|
||||
return nil, SNOServiceErr.Wrap(err)
|
||||
}
|
||||
|
||||
trash, err := s.pieceStore.SpaceUsedForTrash(ctx)
|
||||
if err != nil {
|
||||
return nil, SNOServiceErr.Wrap(err)
|
||||
}
|
||||
@ -180,6 +185,7 @@ func (s *Service) GetDashboardData(ctx context.Context) (_ *Dashboard, err error
|
||||
data.DiskSpace = DiskSpaceInfo{
|
||||
Used: piecesContentSize,
|
||||
Available: s.allocatedDiskSpace.Int64(),
|
||||
Trash: trash,
|
||||
}
|
||||
|
||||
data.Bandwidth = BandwidthInfo{
|
||||
|
Loading…
Reference in New Issue
Block a user