From 3732d4a2673cbe5e7b4c39b7fa2c211da0689d84 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 1 Jan 2016 16:13:16 -0400 Subject: info: Fix "backend usage" numbers, which were counting present keys twice. Let's just count the referenced keys for that, and not present keys at all. --- Command/Info.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Command') diff --git a/Command/Info.hs b/Command/Info.hs index d22c23c04..763279612 100644 --- a/Command/Info.hs +++ b/Command/Info.hs @@ -403,11 +403,8 @@ disk_size = simpleStat "available local disk space" $ backend_usage :: Stat backend_usage = stat "backend usage" $ json fmt $ - calc - <$> (backendsKeys <$> cachedReferencedData) - <*> (backendsKeys <$> cachedPresentData) + sort . M.toList . backendsKeys <$> cachedReferencedData where - calc x y = sort $ M.toList $ M.unionWith (+) x y fmt = multiLine . map (\(n, b) -> b ++ ": " ++ show n) . map swap numcopies_stats :: Stat -- cgit v1.2.3