siridb

package
v0.0.0-...-a212069 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTarget

func NewTarget() targets.ImplementedTarget

Types

type Serializer

type Serializer struct{}

Serializer writes a Point in a serialized form for SiriDB

func (*Serializer) Serialize

func (s *Serializer) Serialize(p *data.Point, w io.Writer) error

Serialize writes Point data to the given writer.

The format is is serialized in such a way that a known number of bytes acting as a header indicate the number of bytes of content that will follow.

The first 8 bytes are reserved for the main header that is filled at the end of the script. 4 bytes of this are for number of metrics and 4 bytes for the length of the measuremnt name and tags.

There are also sub headers of 8 bytes reserved for every data point that are filled in later. 4 bytes for the length of the field key and 4 bytes for the length of the packed data (timestamp and value).

The output looks like this: <number of metrics> <length of name and tags> <name and tags> <length of field key_1> <length of timestamp_1 and field value_1> <field key_1> <packed timestamp_1 and value_1> <length of field key_2> <length of timestamp_1 and field value_2> <field key_2> <packed timestamp_1 and value_2>... etc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL