influxdb-0.9.1.2: Haskell client library for InfluxDB

Safe HaskellNone
LanguageHaskell2010

Database.InfluxDB.Encode

Synopsis

Documentation

class ToSeries a where Source

A type that can be converted to a Series.

Methods

toSeries :: a -> Series Source

class ToSeriesData a where Source

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 Event where
  toSeriesColumn _ = V.fromList ["user", "type"]
  toSeriesPoints (Event user ty) = V.fromList [toValue user, toValue ty]

instance ToValue EventType

Methods

toSeriesColumns :: Proxy a -> Vector Column Source

Column names. You can safely ignore the proxy agument.

toSeriesPoints :: a -> Vector Value Source

Data points.