packages feed

mem-info 0.3.0.0 → 0.3.0.1

raw patch · 3 files changed

+20/−15 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -2,6 +2,10 @@  `mem-info` uses [PVP Versioning][1]. +## 0.3.0.1 -- 2025-01-17++- Fix test data generation in QuickCheck test+ ## 0.3.0.0 -- 2024-03-17  - Extended the dependency bounds to allow all bytestring 0.12.x
mem-info.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               mem-info-version:            0.3.0.0+version:            0.3.0.1 synopsis:           Print the core memory usage of programs description:   A utility to accurately report the core memory usage of programs.
src/System/MemInfo/Proc.hs view
@@ -55,7 +55,8 @@ instance Validity StatusInfo where   validate StatusInfo {siName, siParent} =     let name' = Text.strip siName-        nameOk = Text.length name' > 0 && siName == name'+        noNewlines = not $ Text.any (== '\n') siName+        nameOk = noNewlines && Text.length name' > 0 && siName == name'      in mconcat           [ check nameOk "the process name"           , delve "the process ID" $ toInteger siParent@@ -121,7 +122,7 @@  -- | Combine @'ProcUsage'@, grouping them by the effective program name amass ::-  Ord a =>+  (Ord a) =>   Bool ->   [(a, ProcUsage)] ->   Map a MemUsage@@ -158,7 +159,7 @@   incrSubTotals ::-  Ord a =>+  (Ord a) =>   Bool ->   Map a SubTotal ->   (a, ProcUsage) ->@@ -335,19 +336,19 @@ incrSmapStats :: SmapStats -> Text -> SmapStats incrSmapStats acc l =   if-      | Text.isPrefixOf "Private_Hugetlb:" l -> incrPrivateHuge acc $ smapValMb l-      | Text.isPrefixOf "Shared_Hugetlb:" l -> incrSharedHuge acc $ smapValMb l-      | Text.isPrefixOf "Shared" l -> incrShared acc $ smapValMb l-      | Text.isPrefixOf "Private" l -> incrPrivate acc $ smapValMb l-      | Text.isPrefixOf "Pss:" l ->-          let acc' = acc {ssHasPss = True, ssPssCount = 1 + ssPssCount acc}-           in incrPss acc' $ smapValMb l-      | Text.isPrefixOf "Swap:" l -> incrSwap acc $ smapValMb l-      | Text.isPrefixOf "SwapPss:" l -> incrSwapPss (acc {ssHasSwapPss = True}) $ smapValMb l-      | otherwise -> acc+    | Text.isPrefixOf "Private_Hugetlb:" l -> incrPrivateHuge acc $ smapValMb l+    | Text.isPrefixOf "Shared_Hugetlb:" l -> incrSharedHuge acc $ smapValMb l+    | Text.isPrefixOf "Shared" l -> incrShared acc $ smapValMb l+    | Text.isPrefixOf "Private" l -> incrPrivate acc $ smapValMb l+    | Text.isPrefixOf "Pss:" l ->+        let acc' = acc {ssHasPss = True, ssPssCount = 1 + ssPssCount acc}+         in incrPss acc' $ smapValMb l+    | Text.isPrefixOf "Swap:" l -> incrSwap acc $ smapValMb l+    | Text.isPrefixOf "SwapPss:" l -> incrSwapPss (acc {ssHasSwapPss = True}) $ smapValMb l+    | otherwise -> acc  -smapValMb :: Read a => Text -> Maybe a+smapValMb :: (Read a) => Text -> Maybe a smapValMb l =   let memWords = Text.words l       readVal (_ : x : _) = readMaybe $ Text.unpack x