diff options
| author | Chris Lu <chris.lu@gmail.com> | 2014-03-26 13:22:27 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2014-03-26 13:22:27 -0700 |
| commit | 59f6a13609e63d23ffd4410edce38223a5705232 (patch) | |
| tree | 1771a059d05e298f032d30537b5fdfe7bc9a77d3 /go/stats/disk.go | |
| parent | 39b774a131ac3bc454a516f7b72dcefabc593103 (diff) | |
| download | seaweedfs-59f6a13609e63d23ffd4410edce38223a5705232.tar.xz seaweedfs-59f6a13609e63d23ffd4410edce38223a5705232.zip | |
adding lots of different stats
Diffstat (limited to 'go/stats/disk.go')
| -rw-r--r-- | go/stats/disk.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/go/stats/disk.go b/go/stats/disk.go index acbbd51b9..d0ffcd679 100644 --- a/go/stats/disk.go +++ b/go/stats/disk.go @@ -7,13 +7,14 @@ import ( ) type DiskStatus struct { - All uint64 `json:"all"` - Used uint64 `json:"used"` - Free uint64 `json:"free"` + Dir string + All uint64 + Used uint64 + Free uint64 } -func DiskUsage(path string) (disk *DiskStatus) { - disk = &DiskStatus{} +func NewDiskStatus(path string) (disk *DiskStatus) { + disk = &DiskStatus{Dir: path} fs := syscall.Statfs_t{} err := syscall.Statfs(path, &fs) if err != nil { |
