influxdb-0.0.0: Haskell client library for InfluxDB

Safe HaskellNone

Database.InfluxDB.Encode

Synopsis

Documentation

class ToSeries a whereSource

A type that can be converted to a Series.

Methods

toSeries :: a -> SeriesSource

class ToSeriesData a whereSource

A type that can be converted to a SeriesData. A typical implementation is as follows.

 import qualified Data.Vector as V

 data Event = Event Text EventType
 data EventType = Login | Logout

 instance ToSeriesData where
   toSeriesColumn _ = V.fromList ["user", "type"]
   toSeriesPoints (Event user ty) = V.fromList [toValue user, toValue ty]

 instance ToValue EventType

Methods

toSeriesColumns :: Proxy a -> Vector ColumnSource

Column names. You can safely ignore the proxy agument.

toSeriesPoints :: a -> Vector ValueSource

Data points.