+
+
+
+
+
Disk Stats
+
+
+
+ Path |
+ Disk |
+ Total |
+ Free |
+ Usage |
+
+
+
+ {{ range .DiskStatuses }}
+
+ {{ .Dir }} |
+ {{ .DiskType }} |
+ {{ bytesToHumanReadable .All }} |
+ {{ bytesToHumanReadable .Free }} |
+ {{ percentFrom .All .Used}}% |
+
+ {{ end }}
+
+
+
+
+
+
System Stats
+
+
+ Masters |
+ {{.Masters}} |
+
+
+ Weekly # ReadRequests |
+ {{ .Counters.ReadRequests.WeekCounter.ToList | join }}
+ |
+
+
+ Daily # ReadRequests |
+ {{ .Counters.ReadRequests.DayCounter.ToList | join }}
+ |
+
+
+ Hourly # ReadRequests |
+ {{ .Counters.ReadRequests.HourCounter.ToList | join }}
+ |
+
+
+ Last Minute # ReadRequests |
+ {{ .Counters.ReadRequests.MinuteCounter.ToList | join }}
+ |
+
+ {{ range $key, $val := .Stats }}
+
+ {{ $key }} |
+ {{ $val }} |
+
+ {{ end }}
+
+
+
+
+
+
Volumes
+
+
+
+ Id |
+ Collection |
+ Disk |
+ Data Size |
+ Files |
+ Trash |
+ TTL |
+ ReadOnly |
+
+
+
+ {{ range .Volumes }}
+
+ {{ .Id }} |
+ {{ .Collection }} |
+ {{ .DiskType }} |
+ {{ bytesToHumanReadable .Size }} |
+ {{ .FileCount }} |
+ {{ .DeleteCount }} / {{bytesToHumanReadable .DeletedByteCount}} |
+ {{ .Ttl }} |
+ {{ .ReadOnly }} |
+
+ {{ end }}
+
+
+
+
+ {{ if isNotEmpty .RemoteVolumes }}
+
+
Remote Volumes
+
+
+
+ Id |
+ Collection |
+ Size |
+ Files |
+ Trash |
+ Remote |
+ Key |
+
+
+
+ {{ range .RemoteVolumes }}
+
+ {{ .Id }} |
+ {{ .Collection }} |
+ {{ bytesToHumanReadable .Size }} |
+ {{ .FileCount }} |
+ {{ .DeleteCount }} / {{bytesToHumanReadable .DeletedByteCount}} |
+ {{ .RemoteStorageName }} |
+ {{ .RemoteStorageKey }} |
+
+ {{ end }}
+
+
+
+ {{ end }}
+
+ {{ if isNotEmpty .EcVolumes }}
+
+
Erasure Coding Shards
+
+
+
+ Id |
+ Collection |
+ Shard Size |
+ Shards |
+ CreatedAt |
+
+
+
+ {{ range .EcVolumes }}
+
+ {{ .VolumeId }} |
+ {{ .Collection }} |
+ {{ bytesToHumanReadable .ShardSize }} |
+ {{ .ShardIdList }} |
+ {{ .CreatedAt.Format "02 Jan 06 15:04 -0700" }} |
+
+ {{ end }}
+
+
+
+ {{ end }}
+
+
+
diff --git a/weed/server/webdav_server.go b/weed/server/webdav_server.go
index c6550a36f..68c1f3233 100644
--- a/weed/server/webdav_server.go
+++ b/weed/server/webdav_server.go
@@ -532,7 +532,7 @@ func (f *WebDavFile) Read(p []byte) (readSize int, err error) {
return 0, io.EOF
}
if f.entryViewCache == nil {
- f.entryViewCache, _ = filer.NonOverlappingVisibleIntervals(filer.LookupFn(f.fs), f.entry.Chunks)
+ f.entryViewCache, _ = filer.NonOverlappingVisibleIntervals(filer.LookupFn(f.fs), f.entry.Chunks, 0, math.MaxInt64)
f.reader = nil
}
if f.reader == nil {
diff --git a/weed/shell/command_collection_list.go b/weed/shell/command_collection_list.go
index 2a114e61b..ba502a6b9 100644
--- a/weed/shell/command_collection_list.go
+++ b/weed/shell/command_collection_list.go
@@ -22,6 +22,14 @@ func (c *commandCollectionList) Help() string {
return `list all collections`
}
+type CollectionInfo struct {
+ FileCount uint64
+ DeleteCount uint64
+ DeletedByteCount uint64
+ Size uint64
+ VolumeCount int
+}
+
func (c *commandCollectionList) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
collections, err := ListCollectionNames(commandEnv, true, true)
@@ -30,8 +38,21 @@ func (c *commandCollectionList) Do(args []string, commandEnv *CommandEnv, writer
return err
}
+ topologyInfo, _, err := collectTopologyInfo(commandEnv)
+ if err != nil {
+ return err
+ }
+
+ collectionInfos := make(map[string]*CollectionInfo)
+
+ writeCollectionInfo(writer, topologyInfo, collectionInfos)
+
for _, c := range collections {
- fmt.Fprintf(writer, "collection:\"%s\"\n", c)
+ cif, found := collectionInfos[c]
+ if !found {
+ continue
+ }
+ fmt.Fprintf(writer, "collection:\"%s\"\tvolumeCount:%d\tsize:%d\tfileCount:%d\tdeletedBytes:%d\tdeletion:%d\n", c, cif.VolumeCount, cif.Size, cif.FileCount, cif.DeletedByteCount, cif.DeleteCount)
}
fmt.Fprintf(writer, "Total %d collections.\n", len(collections))
@@ -56,3 +77,34 @@ func ListCollectionNames(commandEnv *CommandEnv, includeNormalVolumes, includeEc
}
return
}
+
+func addToCollection(collectionInfos map[string]*CollectionInfo, vif *master_pb.VolumeInformationMessage) {
+ c := vif.Collection
+ cif, found := collectionInfos[c]
+ if !found {
+ cif = &CollectionInfo{}
+ collectionInfos[c] = cif
+ }
+ cif.Size += vif.Size
+ cif.DeleteCount += vif.DeleteCount
+ cif.FileCount += vif.FileCount
+ cif.DeletedByteCount += vif.DeletedByteCount
+ cif.VolumeCount++
+}
+
+func writeCollectionInfo(writer io.Writer, t *master_pb.TopologyInfo, collectionInfos map[string]*CollectionInfo) {
+ for _, dc := range t.DataCenterInfos {
+ for _, r := range dc.RackInfos {
+ for _, dn := range r.DataNodeInfos {
+ for _, diskInfo := range dn.DiskInfos {
+ for _, vi := range diskInfo.VolumeInfos {
+ addToCollection(collectionInfos, vi)
+ }
+ //for _, ecShardInfo := range diskInfo.EcShardInfos {
+ //
+ //}
+ }
+ }
+ }
+ }
+}
diff --git a/weed/shell/command_ec_decode.go b/weed/shell/command_ec_decode.go
index dafdb041a..e4d597d84 100644
--- a/weed/shell/command_ec_decode.go
+++ b/weed/shell/command_ec_decode.go
@@ -223,21 +223,6 @@ func collectTopologyInfo(commandEnv *CommandEnv) (topoInfo *master_pb.TopologyIn
}
-func collectEcShardInfos(topoInfo *master_pb.TopologyInfo, selectedCollection string, vid needle.VolumeId) (ecShardInfos []*master_pb.VolumeEcShardInformationMessage) {
-
- eachDataNode(topoInfo, func(dc string, rack RackId, dn *master_pb.DataNodeInfo) {
- if diskInfo, found := dn.DiskInfos[string(types.HardDriveType)]; found {
- for _, v := range diskInfo.EcShardInfos {
- if v.Collection == selectedCollection && v.Id == uint32(vid) {
- ecShardInfos = append(ecShardInfos, v)
- }
- }
- }
- })
-
- return
-}
-
func collectEcShardIds(topoInfo *master_pb.TopologyInfo, selectedCollection string) (vids []needle.VolumeId) {
vidMap := make(map[uint32]bool)
diff --git a/weed/shell/command_fs_configure.go b/weed/shell/command_fs_configure.go
index 02cd7ac69..0aae51d74 100644
--- a/weed/shell/command_fs_configure.go
+++ b/weed/shell/command_fs_configure.go
@@ -30,17 +30,17 @@ func (c *commandFsConfigure) Help() string {
fs.configure
# trying the changes and see the possible configuration file content
- fs.configure -locationPrfix=/my/folder -collection=abc
- fs.configure -locationPrfix=/my/folder -collection=abc -ttl=7d
+ fs.configure -locationPrefix=/my/folder -collection=abc
+ fs.configure -locationPrefix=/my/folder -collection=abc -ttl=7d
# example: configure adding only 1 physical volume for each bucket collection
- fs.configure -locationPrfix=/buckets/ -volumeGrowthCount=1
+ fs.configure -locationPrefix=/buckets/ -volumeGrowthCount=1
# apply the changes
- fs.configure -locationPrfix=/my/folder -collection=abc -apply
+ fs.configure -locationPrefix=/my/folder -collection=abc -apply
# delete the changes
- fs.configure -locationPrfix=/my/folder -delete -apply
+ fs.configure -locationPrefix=/my/folder -delete -apply
`
}
@@ -54,6 +54,7 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io
ttl := fsConfigureCommand.String("ttl", "", "assign writes with this ttl")
diskType := fsConfigureCommand.String("disk", "", "[hdd|ssd|