Copyright | (c) Daniel Lovasko 2016-2017 |
---|---|
License | BSD3 |
Maintainer | Daniel Lovasko <daniel.lovasko@gmail.com> |
Stability | stable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Goat is a time series compression implementation in pure Haskell. It is heavily based on Facebook's Gorilla algorithm [1].
- data Story = Story Word32 Word32 (Fluid Word32 TimeFrame) (Fluid Float ValueFrame)
- data TimeFrame = TimeFrame (Maybe Word32) (Maybe Word32) Word32 ByteString
- data ValueFrame = ValueFrame (Maybe Word32) Word32 ByteString
- storyAppend :: Story -> (Word32, Float) -> Maybe Story
- storyDump :: Story -> [(Word32, Float)]
- storyNew :: Word32 -> Word32 -> Story
- storyQuery :: Story -> (Word32, Word32) -> [(Word32, Float)]
- timeDecode :: TimeFrame -> [Word32]
- timeEncode :: [Word32] -> TimeFrame
- valueDecode :: ValueFrame -> [Float]
- valueEncode :: [Float] -> ValueFrame
Documentation
Representation of a time series object. The constructor arguments are as follows: * time window size * current time window number * times fluid * values fluid
Succinct representation of a list of time points. The constructor arguments are as follows: * first time point * second time point * number of valid bits * bits
data ValueFrame Source #
Succinct representation of a list of value points. The constructor arguments are as follows: * first value * number of valid bits * bits
Eq ValueFrame Source # | |
Show ValueFrame Source # | Pretty-printing of the ValueFrame type. |
Serialize ValueFrame Source # | Binary serialization of the ValueFrame type. All integers are using the big-endian byte order. |
Frame Float ValueFrame Source # | Binding of Float and ValueFrame. |
Add new time/value pair to the story. The function will return Nothing in case that the value was invalid (NaN or Infinity) or when the time was invalid with respect to previously added times (breaking the series monotonicity).
Output a list of all time/value pairs stored in the story.
Create a new empty story. The ratio of raw/compressed sections is 12/74. These fields will be configurable in the future versions of the module.
Query the story for time/value pairs within the specified time limit.
Unpack time points from the succinct frame.
Pack a list of _ascending_ time points into a succinct frame form.
:: ValueFrame | succinct frame form |
-> [Float] | value points |
Unpack value points from the succinct frame.
:: [Float] | value points |
-> ValueFrame | succinct frame form |
Encode a list of float values into a succinct value frame.