packages feed

statsd-rupp 0.4.0.3 → 0.4.0.4

raw patch · 3 files changed

+5/−18 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -6,6 +6,10 @@ and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). +## 0.4.0.4 - 2023-09-11++- Relax constraints on values to avoid runtime errors.+ ## 0.4.0.3 - 2023-09-11  - Show invalid value and key.
src/System/Metrics/StatsD/Internal.hs view
@@ -206,13 +206,6 @@   where     valid c = elem c ("._-" :: [Char]) || isAscii c && isAlphaNum c -validateValue :: Value -> Bool-validateValue (Counter c) = c > 0-validateValue (Gauge g False) = g > 0-validateValue (Gauge _ True) = True-validateValue (Timing t) = t > 0-validateValue (Set e) = validateKey e- addReading :: Value -> ByteString -> Metrics -> Metrics addReading reading = HashMap.adjust adjust   where@@ -240,16 +233,6 @@ processSample ::   (MonadIO m) => Stats -> Int -> ByteString -> Value -> m () processSample stats sampling key val = do-  when (0 > sampling) $-    throwIO $-      userError "StatsD sampling rate must not be negative"-  unless (validateValue val) $-    throwIO $-      userError $-        "StatsD value is not valid for key \""-          <> C.unpack key-          <> "\": "-          <> show val   idx <- atomically $ newReading stats key val   when stats.params.samples $     submit stats $
statsd-rupp.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           statsd-rupp-version:        0.4.0.3+version:        0.4.0.4 synopsis:       Simple StatsD Client description:    Please see the README on GitHub at <https://github.com/jprupp/statsd-rupp#readme> category:       System