support customizable disk type

This commit is contained in:
Chris Lu
2021-02-13 15:42:42 -08:00
parent 4bd8a692d8
commit 7ce647f27e
7 changed files with 17 additions and 14 deletions

View File

@@ -373,10 +373,3 @@ func (l *DiskLocation) CheckDiskSpace() {
}
}
func (l *DiskLocation) GetDiskType() string {
if l.DiskType == SsdType {
return "SSD"
}
return "HDD"
}

View File

@@ -173,6 +173,7 @@ func collectStatForOneVolume(vid needle.VolumeId, v *Volume) (s *VolumeInfo) {
ReadOnly: v.IsReadOnly(),
Ttl: v.Ttl,
CompactRevision: uint32(v.CompactionRevision),
DiskType: v.DiskType().String(),
}
s.RemoteStorageName, s.RemoteStorageKey = v.RemoteStorageNameKey()

View File

@@ -24,3 +24,10 @@ func ToDiskType(vt string) (diskType DiskType) {
}
return
}
func (diskType DiskType) String() string{
if diskType == "" {
return "hdd"
}
return string(diskType)
}