tempodb 0.2.1.0 → 0.2.2.0
raw patch · 4 files changed
+24/−4 lines, 4 files
Files
- DEBT +1/−0
- src/Database/Tempodb/Methods/Read.hs +17/−1
- src/Database/Tempodb/Types.hs +5/−2
- tempodb.cabal +1/−1
DEBT view
@@ -9,3 +9,4 @@ 2. [ ] The IdOrKey translation into the correct path string is messy and I'm repeating the same where functions in many different functions (which is bad!).+3. [ ] Hackage docs! I haven't written anything. Naughty me.
src/Database/Tempodb/Methods/Read.hs view
@@ -2,7 +2,7 @@ module Database.Tempodb.Methods.Read ( readOne---, readMulti+, readMulti ) where @@ -33,5 +33,21 @@ path = rootpath <> "/series" <> (ident q) <> "/data" <> query query = case qa of+ Nothing -> mempty+ Just qry -> "?" <> (C8.pack $ urlEncodeVars qry)++readMulti :: Maybe QueryArgs -> Tempodb (Maybe [SeriesData])+readMulti q = do+ auth <- ask+ req <- liftIO . buildRequest $ do+ http GET path+ auth++ (_,result) <- liftIO $ runRequest req Nothing+ return . A.decode $ fromStrict result++ where+ path = rootpath <> "/data" <> query+ query = case q of Nothing -> mempty Just qry -> "?" <> (C8.pack $ urlEncodeVars qry)
src/Database/Tempodb/Types.hs view
@@ -156,8 +156,11 @@ instance FromJSON TempoDBTime where parseJSON (String t) = case parseTime defaultTimeLocale "%FT%H:%M:%S%Q%z" (T.unpack t) of- Just d -> pure (TempoDBTime d)- _ -> mzero+ Just d -> pure (TempoDBTime d)+ Nothing ->+ case parseTime defaultTimeLocale "%FT%H:%M:%S%Q%Z" (T.unpack t) of+ Just d -> pure (TempoDBTime d)+ Nothing -> mzero parseJSON _ = mzero instance FromJSON Data where
tempodb.cabal view
@@ -1,5 +1,5 @@ name: tempodb-version: 0.2.1.0+version: 0.2.2.0 synopsis: A small Haskell wrapper around the TempoDB api. description: TempoDB is a time-series database as-a-service with a