Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data OutputFormat
- getOutputFormat ∷ Maybe FilePath → IO OutputFormat
- writeDataPoint ∷ Handle → OutputFormat → SlotDataPoint → IO ()
- writeHeader ∷ Handle → OutputFormat → IO ()
- writeMetadata ∷ Handle → OutputFormat → LedgerApplicationMode → IO ()
Output format
data OutputFormat Source #
Instances
getOutputFormat ∷ Maybe FilePath → IO OutputFormat Source #
Use the provided 'Maybe FilePath' to determine the output format.
The output format is based on the extension (see OutputFormat
).
If the extension is not supported the output format defaults to CSV, and this function prints a warning informing the user of this choice.
File writing functions
writeDataPoint ∷ Handle → OutputFormat → SlotDataPoint → IO () Source #
NOTE: This function is not thread safe.
writeHeader ∷ Handle → OutputFormat → IO () Source #
Write a header for the data points.
This is only needed for the CSV output format.
The position of each header matches the position in which the corresponding
field value is written in writeDatapoint
. Eg, if writeHeader
writes:
"slot slotGap totalTime" ...
then the third value written by writeDataPoint
will correspond to totalTime
.
writeMetadata ∷ Handle → OutputFormat → LedgerApplicationMode → IO () Source #
Write metadata to a JSON file if this is the selected format. Perform a no-op otherwise.