summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-21 23:23:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-22 17:32:47 -0400
commit52b90e5d4c2a22415d48a8e572eab328dfcc4407 (patch)
tree0abfbfa6640dcf73c18081654cc5ff359bbd2423
parentd315798609fe82bf753172a807a19cc7203797b6 (diff)
tweak
-rw-r--r--Command/Status.hs34
1 files changed, 17 insertions, 17 deletions
diff --git a/Command/Status.hs b/Command/Status.hs
index 576c3bba6..000374871 100644
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -141,6 +141,20 @@ local_annex_keys :: Stat
local_annex_keys = stat "local annex keys" $ json show $
countKeys <$> cachedPresentData
+known_annex_size :: Stat
+known_annex_size = stat "known annex size" $ json id $
+ showSizeKeys <$> cachedReferencedData
+
+known_annex_keys :: Stat
+known_annex_keys = stat "known annex keys" $ json show $
+ countKeys <$> cachedReferencedData
+
+tmp_size :: Stat
+tmp_size = staleSize "temporary directory size" gitAnnexTmpDir
+
+bad_data_size :: Stat
+bad_data_size = staleSize "bad keys size" gitAnnexBadDir
+
bloom_info :: Stat
bloom_info = stat "bloom filter size" $ json id $ do
localkeys <- countKeys <$> cachedPresentData
@@ -157,10 +171,6 @@ bloom_info = stat "bloom filter size" $ json id $ do
return $ size ++ note
-known_annex_size :: Stat
-known_annex_size = stat "known annex size" $ json id $
- showSizeKeys <$> cachedReferencedData
-
disk_size :: Stat
disk_size = stat "available local disk space" $ json id $ lift go
where
@@ -171,23 +181,13 @@ disk_size = stat "available local disk space" $ json id $ lift go
<*> inRepo (getFileSystemStats . gitAnnexDir)
| otherwise = return unknown
calcfree reserve (Just (FileSystemStats { fsStatBytesAvailable = have })) =
- roughSize storageUnits True $ unreserved reserve have
+ roughSize storageUnits True $ nonneg $ have - reserve
calcfree _ _ = unknown
- unreserved reserve have
- | have >= reserve = have - reserve
+ nonneg x
+ | x >= 0 = x
| otherwise = 0
unknown = "unknown"
-known_annex_keys :: Stat
-known_annex_keys = stat "known annex keys" $ json show $
- countKeys <$> cachedReferencedData
-
-tmp_size :: Stat
-tmp_size = staleSize "temporary directory size" gitAnnexTmpDir
-
-bad_data_size :: Stat
-bad_data_size = staleSize "bad keys size" gitAnnexBadDir
-
backend_usage :: Stat
backend_usage = stat "backend usage" $ nojson $
calc