influxdb 0.9.0.1 → 0.9.1
raw patch · 5 files changed
+36/−57 lines, 5 filesdep ~exceptionsdep ~retryPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: exceptions, retry
API changes (from Hackage documentation)
+ Database.InfluxDB: writeSeriesData :: Monad m => Text -> SeriesData -> SeriesT m ()
+ Database.InfluxDB.Http: writeSeriesData :: Monad m => Text -> SeriesData -> SeriesT m ()
Files
- CHANGELOG.md +7/−0
- influxdb.cabal +4/−15
- src/Database/InfluxDB.hs +1/−0
- src/Database/InfluxDB/Http.hs +20/−18
- src/Database/InfluxDB/Types.hs +4/−24
CHANGELOG.md view
@@ -1,3 +1,10 @@+## v0.9.1 - 2015-03-07++* Add `writeSeriesData`+* Relax upper version bound for exceptions+* Drop support for old retry package+ * retry < 0.6 had an unexpected behavior wrt exception masking state (https://github.com/Soostone/retry/pull/12)+ ## v0.9.0.1 - 2015-01-06 * Support for GHC 7.10.1
influxdb.cabal view
@@ -1,5 +1,5 @@ name: influxdb-version: 0.9.0.1+version: 0.9.1 synopsis: Haskell client library for InfluxDB description: Haskell client library for InfluxDB homepage: https://github.com/maoe/influxdb-haskell@@ -26,11 +26,6 @@ default: True manual: False -flag retry-050- description: Use retry == 0.5.*- default: True- manual: False- flag network-uri description: Get Network.URI from the network-uri package default: True@@ -72,9 +67,10 @@ , containers , data-default-class , dlist- , exceptions >= 0.5 && < 0.7+ , exceptions >= 0.5 && < 0.9 , http-client < 0.5 , mtl < 2.3+ , retry == 0.6 , tagged , template-haskell , text < 1.3@@ -88,13 +84,6 @@ build-depends: aeson >= 0.6.1.0 && < 0.7.0 - if flag(retry-050)- build-depends:- retry == 0.5.*- else- build-depends:- retry == 0.4.*- if flag(network-uri) build-depends: network-uri >= 2.6@@ -153,5 +142,5 @@ source-repository this type: git- tag: v0.9.0.1+ tag: v0.9.1 location: https://github.com/maoe/influxdb-haskell.git
src/Database/InfluxDB.hs view
@@ -40,6 +40,7 @@ , post, postWithPrecision , SeriesT, PointT , writeSeries+ , writeSeriesData , withSeries , writePoints
src/Database/InfluxDB/Http.hs view
@@ -17,6 +17,7 @@ , post, postWithPrecision , SeriesT, PointT , writeSeries+ , writeSeriesData , withSeries , writePoints @@ -81,6 +82,7 @@ import qualified Data.Text as T import Text.Printf (printf) +import Control.Monad.Catch (Handler(..)) import Control.Retry import Data.Aeson ((.=)) import Data.Aeson.TH (deriveToJSON)@@ -100,12 +102,6 @@ import Database.InfluxDB.Stream (Stream(..)) import qualified Database.InfluxDB.Stream as S -#if MIN_VERSION_retry(0, 4, 0)-import Control.Monad.Catch (Handler(..))-#else-import Control.Exception.Lifted (Handler(..))-#endif- -- | Configurations for HTTP API client. data Config = Config { configCreds :: !Credentials@@ -218,9 +214,19 @@ -> a -- ^ Series data -> SeriesT m ()-writeSeries name a = tell . DL.singleton $ Series+writeSeries name = writeSeriesData name . toSeriesData++-- | Write a single series data.+writeSeriesData+ :: Monad m+ => Text+ -- ^ Series name+ -> SeriesData+ -- ^ Series data+ -> SeriesT m ()+writeSeriesData name a = tell . DL.singleton $ Series { seriesName = name- , seriesData = toSeriesData a+ , seriesData = a } -- | Write a bunch of data for a single series. Columns for the points don't@@ -745,16 +751,12 @@ , HC.secure = serverSsl } handlers =- [-#if MIN_VERSION_retry(0, 5, 0)- const $-#endif- Handler $ \e -> case e of- HC.FailedConnectionException {} -> retry- HC.FailedConnectionException2 {} -> retry- HC.InternalIOException {} -> retry- HC.ResponseTimeout {} -> retry- _ -> return False+ [ const $ Handler $ \e -> case e of+ HC.FailedConnectionException {} -> retry+ HC.FailedConnectionException2 {} -> retry+ HC.InternalIOException {} -> retry+ HC.ResponseTimeout {} -> retry+ _ -> return False ] retry = True <$ failover pool
src/Database/InfluxDB/Types.hs view
@@ -43,8 +43,9 @@ import Control.Applicative (empty) import Control.Exception (Exception, throwIO) import Data.Data (Data)-import Data.Int (Int64) import Data.IORef+import Data.Int (Int64)+import Data.Monoid ((<>)) import Data.Sequence (Seq, ViewL(..), (|>)) import Data.Text (Text) import Data.Typeable (Typeable)@@ -53,6 +54,7 @@ import GHC.Generics (Generic) import qualified Data.Sequence as Seq +import Control.Retry (RetryPolicy(..), limitRetries, exponentialBackoff) import Data.Aeson ((.=), (.:)) import Data.Aeson.TH import qualified Data.Aeson as A@@ -65,14 +67,6 @@ import Data.Attoparsec.Number #endif -#if MIN_VERSION_retry(0, 5, 0)-import Data.Monoid ((<>))--import Control.Retry (RetryPolicy(..), limitRetries, exponentialBackoff)-#else-import Control.Retry (RetrySettings(..), limitedRetries)-#endif- ----------------------------------------------------------- -- Compatibility for older GHC @@ -216,10 +210,6 @@ serverRetrySettings :: ServerPool -> RetryPolicy serverRetrySettings = serverRetryPolicy -#if !MIN_VERSION_retry(0, 5, 0)-type RetryPolicy = RetrySettings-#endif- newtype Database = Database { databaseName :: Text } deriving (Show, Typeable, Generic)@@ -259,17 +249,7 @@ newServerPool :: Server -> [Server] -> IO (IORef ServerPool) newServerPool = newServerPoolWithRetrySettings defaultRetryPolicy where-#if MIN_VERSION_retry(0, 5, 0)- defaultRetryPolicy =- limitRetries 5 <>- exponentialBackoff 50-#else- defaultRetryPolicy = RetrySettings- { numRetries = limitedRetries 5- , backoff = True- , baseDelay = 50- }-#endif+ defaultRetryPolicy = limitRetries 5 <> exponentialBackoff 50 newServerPoolWithRetryPolicy :: RetryPolicy -> Server -> [Server] -> IO (IORef ServerPool)