diff options
| author | chrislu <chris.lu@gmail.com> | 2022-07-04 13:46:32 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-07-04 13:46:32 -0700 |
| commit | a79f5bd0d5ca01d4e53f016f42cb2103f9d7dad1 (patch) | |
| tree | 6ba0e3dcac670e45dce949ec9d6ad75243ccd7ff | |
| parent | 3c79c770562ef4f7c0d4e57a88f616eb3671b9cd (diff) | |
| download | seaweedfs-a79f5bd0d5ca01d4e53f016f42cb2103f9d7dad1.tar.xz seaweedfs-a79f5bd0d5ca01d4e53f016f42cb2103f9d7dad1.zip | |
adjust used size reporting
| -rw-r--r-- | weed/shell/command_fs_du.go | 2 | ||||
| -rw-r--r-- | weed/topology/volume_location_list.go | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/weed/shell/command_fs_du.go b/weed/shell/command_fs_du.go index 71003714d..919c052d5 100644 --- a/weed/shell/command_fs_du.go +++ b/weed/shell/command_fs_du.go @@ -76,7 +76,7 @@ func duTraverseDirectory(writer io.Writer, filerClient filer_pb.FilerClient, dir } if name != "" && !entry.IsDirectory { - fmt.Fprintf(writer, "block:%4d\tbyte:%10d\t%s/%s\n", fileBlockCount, fileByteCount, dir, entry.Name) + fmt.Fprintf(writer, "block:%4d\tlogical size:%10d\t%s/%s\n", fileBlockCount, fileByteCount, dir, entry.Name) } return nil }) diff --git a/weed/topology/volume_location_list.go b/weed/topology/volume_location_list.go index 03580ae5b..00bd8d199 100644 --- a/weed/topology/volume_location_list.go +++ b/weed/topology/volume_location_list.go @@ -82,12 +82,13 @@ func (dnll *VolumeLocationList) Refresh(freshThreshHold int64) { } } +// Stats returns logic size and count func (dnll *VolumeLocationList) Stats(vid needle.VolumeId, freshThreshHold int64) (size uint64, fileCount int) { for _, dnl := range dnll.list { if dnl.LastSeen < freshThreshHold { vinfo, err := dnl.GetVolumesById(vid) if err == nil { - return (vinfo.Size - vinfo.DeletedByteCount) * uint64(len(dnll.list)), vinfo.FileCount - vinfo.DeleteCount + return (vinfo.Size - vinfo.DeletedByteCount), vinfo.FileCount - vinfo.DeleteCount } } } |
