util.BytesToHumanReadable

This commit is contained in:
bingoohuang
2020-05-29 10:00:07 +08:00
parent 21d0a013d5
commit accb4964b7
4 changed files with 34 additions and 25 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"flag"
"fmt"
"github.com/chrislusf/seaweedfs/weed/util"
"os"
"path"
"strconv"
@@ -36,7 +37,8 @@ func main() {
defer indexFile.Close()
idx.WalkIndexFile(indexFile, func(key types.NeedleId, offset types.Offset, size uint32) error {
fmt.Printf("key:%v offset:%v size:%v\n", key, offset, size)
// key:1 offset:1 size:17214(16.81 KiB)
fmt.Printf("key:%v offset:%v size:%v(%v)\n", key, offset, size, util.BytesToHumanReadable(uint64(size)))
return nil
})