wolf 0.3.13 → 0.3.14
raw patch · 5 files changed
+17/−10 lines, 5 files
Files
- Shakefile.hs +2/−2
- src/Network/AWS/Wolf/Act.hs +2/−2
- src/Network/AWS/Wolf/Ctx.hs +10/−3
- src/Network/AWS/Wolf/Decide.hs +2/−2
- wolf.cabal +1/−1
Shakefile.hs view
@@ -37,8 +37,8 @@ -- | sanity -- fake "." pats "sanity" $ const $- need [ fakeFile "build-error", fakeFile "lint" ]+ need [ "build-error", "lint" ] -- | Default things to run. --- want [ fakeFile "sanity", fakeFile "format" ]+ want [ "sanity", "format" ]
src/Network/AWS/Wolf/Act.hs view
@@ -69,7 +69,7 @@ t0 <- liftIO getCurrentTime (token, uid, input) <- pollActivity t1 <- liftIO getCurrentTime- statsCount "wolf.act.poll.count" (1 :: Int) [ "queue" =. queue ]+ statsIncrement "wolf.act.poll.count" [ "queue" =. queue ] statsHistogram "wolf.act.poll.elapsed" (realToFrac (diffUTCTime t1 t0) :: Double) [ "queue" =. queue ] maybe_ token $ \token' -> maybe_ uid $ \uid' ->@@ -91,7 +91,7 @@ t3 <- liftIO getCurrentTime traceInfo "finish" [ "output" .= output ] let status = textFromString $ maybe "complete" (const "fail") e- statsCount "wolf.act.activity.count" (1 :: Int) [ "queue" =. queue, "status" =. status ]+ statsIncrement "wolf.act.activity.count" [ "queue" =. queue, "status" =. status ] statsHistogram "wolf.act.activity.elapsed" (realToFrac (diffUTCTime t3 t2) :: Double) [ "queue" =. queue ]
src/Network/AWS/Wolf/Ctx.hs view
@@ -28,9 +28,16 @@ catcher :: MonadStatsCtx c m => SomeException -> m a catcher e = do traceError "exception" [ "error" .= displayException e ]- statsCount "wolf.exception" (1 :: Int) mempty throwIO e +-- | Like catcher, but with stats.+--+catcher' :: MonadStatsCtx c m => SomeException -> m a+catcher' e = do+ traceError "exception" [ "error" .= displayException e ]+ statsIncrement "wolf.exception" [ "reason" =. show e ]+ throwIO e+ -- | Run configuration context. -- runConfCtx :: MonadStatsCtx c m => Conf -> TransT ConfCtx m a -> m a@@ -41,7 +48,7 @@ , "prefix" .= (conf ^. cPrefix) ] c <- view statsCtx <&> cPreamble <>~ preamble- runTransT (ConfCtx c conf) $ catch action catcher+ runTransT (ConfCtx c conf) $ catch action catcher' -- | Update configuration context's preamble. --@@ -84,7 +91,7 @@ throttled :: MonadAmazon c m => m a -> m a throttled action = do traceError "throttled" mempty- statsCount "wolf.throttled" (1 :: Int) mempty+ statsIncrement "wolf.throttled" mempty liftIO $ threadDelay $ 5 * 1000000 catch action $ throttler action
src/Network/AWS/Wolf/Decide.hs view
@@ -96,7 +96,7 @@ t0 <- liftIO getCurrentTime (token, hes) <- pollDecision t1 <- liftIO getCurrentTime- statsCount "wolf.decide.poll.count" (1 :: Int) [ "queue" =. queue ]+ statsIncrement "wolf.decide.poll.count" [ "queue" =. queue ] statsHistogram "wolf.decide.poll.elapsed" (realToFrac (diffUTCTime t1 t0) :: Double) [ "queue" =. queue ] maybe_ token $ \token' -> runAmazonDecisionCtx p hes $ do@@ -106,7 +106,7 @@ completeDecision token' t3 <- liftIO getCurrentTime traceInfo "finish" mempty- statsCount "wolf.decide.decision.count" (1 :: Int) [ "queue" =. queue ]+ statsIncrement "wolf.decide.decision.count" [ "queue" =. queue ] statsHistogram "wolf.decide.decision.elapsed" (realToFrac (diffUTCTime t3 t2) :: Double) [ "queue" =. queue ] -- | Run decider from main with config file.
wolf.cabal view
@@ -1,5 +1,5 @@ name: wolf-version: 0.3.13+version: 0.3.14 synopsis: Amazon Simple Workflow Service Wrapper. description: Wolf is a wrapper around Amazon Simple Workflow Service. homepage: https://github.com/swift-nav/wolf