RowBinary

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 13 Imported by: 15

Documentation

Index

Constants

View Source
const (
	SIZE_INT64 = 8
	SIZE_INT16 = 2
	SIZE_INT32 = 4
)
View Source
const WriteBufferSize = 524288

Variables

View Source
var TimestampToDays func(timestamp uint32) uint16

Functions

func PrecalcTimestampToDays added in v0.11.4

func PrecalcTimestampToDays(timestamp uint32) uint16

PrecalcTimestampToDays is broken, not always UTC, like SlowTimestampToDays

func ReverseBytes added in v0.6.1

func ReverseBytes(target []byte) []byte

func ReverseBytesTo added in v0.11.2

func ReverseBytesTo(dst []byte, src []byte)

func SetDefaultDate added in v0.11.4

func SetDefaultDate()

PrecalcTimestampToDays is broken, not always UTC, like SlowTimestampToDays, but used from start of project

func SetUTCDate added in v0.11.4

func SetUTCDate()

UTCTimestampToDays is always UTC, but mismatch SlowTimestampToDays and need points/index/tags table rebuild (with Date recalc)

func SlowTimestampToDays added in v0.8.1

func SlowTimestampToDays(timestamp uint32) uint16

SlowTimestampToDays is broken, not always UTC

func TimeToDaysFormat added in v0.11.4

func TimeToDaysFormat(t time.Time) string

TimeToDaysFormat like TimestampDaysFormat, but for time.Time

func TimestampToDaysFormat added in v0.11.4

func TimestampToDaysFormat(timestamp int64) string

TimestampToDaysFormat is pair for SlowTimestampToDays and broken also for symmetric

func UTCTimestampToDays added in v0.11.4

func UTCTimestampToDays(timestamp uint32) uint16

func UTCTimestampToDaysFormat added in v0.11.4

func UTCTimestampToDaysFormat(timestamp uint32) string

func WriteBytes added in v0.8.1

func WriteBytes(w io.Writer, p []byte) error

func WriteUint16 added in v0.8.1

func WriteUint16(w io.Writer, value uint16) error

func WriteUint32 added in v0.8.1

func WriteUint32(w io.Writer, value uint32) error

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Read all good records from unfinished RowBinary file.

func NewReader

func NewReader(filename string, reverse bool) (*Reader, error)

func (*Reader) Close

func (r *Reader) Close()

func (*Reader) Days

func (r *Reader) Days() uint16

func (*Reader) DaysString

func (r *Reader) DaysString() string

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

func (*Reader) ReadRecord

func (r *Reader) ReadRecord() ([]byte, error)

func (*Reader) SetZeroVersion added in v0.9.0

func (r *Reader) SetZeroVersion(v bool)

func (*Reader) Timestamp

func (r *Reader) Timestamp() uint32

func (*Reader) Value

func (r *Reader) Value() float64

func (*Reader) Version

func (r *Reader) Version() uint32

type WriteBuffer

type WriteBuffer struct {
	Used int
	Body [WriteBufferSize]byte
	// contains filtered or unexported fields
}

func GetWriteBuffer

func GetWriteBuffer() *WriteBuffer

func GetWriterBufferWithConfirm added in v0.6.1

func GetWriterBufferWithConfirm(wg *sync.WaitGroup, errorChan chan error) *WriteBuffer

func (*WriteBuffer) Bytes

func (wb *WriteBuffer) Bytes() []byte

func (*WriteBuffer) CanWriteGraphitePoint

func (wb *WriteBuffer) CanWriteGraphitePoint(metricLen int) bool

func (*WriteBuffer) Confirm added in v0.6.1

func (wb *WriteBuffer) Confirm()

func (*WriteBuffer) ConfirmRequired added in v0.6.1

func (wb *WriteBuffer) ConfirmRequired() bool

func (*WriteBuffer) Empty

func (wb *WriteBuffer) Empty() bool

func (*WriteBuffer) Fail added in v0.6.1

func (wb *WriteBuffer) Fail(err error)

func (*WriteBuffer) FreeSize added in v0.11.2

func (wb *WriteBuffer) FreeSize() int

func (*WriteBuffer) Len added in v0.11.2

func (wb *WriteBuffer) Len() int

func (*WriteBuffer) Release

func (wb *WriteBuffer) Release()

func (*WriteBuffer) Reset

func (wb *WriteBuffer) Reset() *WriteBuffer

func (*WriteBuffer) Write

func (wb *WriteBuffer) Write(p []byte)

func (*WriteBuffer) WriteBytes

func (wb *WriteBuffer) WriteBytes(p []byte)

func (*WriteBuffer) WriteFloat64

func (wb *WriteBuffer) WriteFloat64(value float64)

func (*WriteBuffer) WriteGraphitePoint

func (wb *WriteBuffer) WriteGraphitePoint(name []byte, value float64, timestamp uint32, version uint32)

func (*WriteBuffer) WriteGraphitePointTagged added in v0.10.1

func (wb *WriteBuffer) WriteGraphitePointTagged(labels []string, value float64, timestamp uint32, version uint32)

func (*WriteBuffer) WriteReversePath added in v0.6.1

func (wb *WriteBuffer) WriteReversePath(p []byte)

func (*WriteBuffer) WriteString added in v0.8.0

func (wb *WriteBuffer) WriteString(s string)

func (*WriteBuffer) WriteTagged added in v0.10.1

func (wb *WriteBuffer) WriteTagged(tagged []string)

func (*WriteBuffer) WriteUVarint added in v0.8.0

func (wb *WriteBuffer) WriteUVarint(v uint64)

func (*WriteBuffer) WriteUint16

func (wb *WriteBuffer) WriteUint16(value uint16)

func (*WriteBuffer) WriteUint32

func (wb *WriteBuffer) WriteUint32(value uint32)

func (*WriteBuffer) WriteUint64

func (wb *WriteBuffer) WriteUint64(value uint64)

type Writer added in v0.9.0

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter added in v0.9.0

func NewWriter(ctx context.Context, writeChan chan *WriteBuffer) *Writer

func (*Writer) Flush added in v0.9.0

func (w *Writer) Flush()

func (*Writer) Now added in v0.9.0

func (w *Writer) Now() uint32

func (*Writer) PointsWritten added in v0.9.0

func (w *Writer) PointsWritten() uint32

func (*Writer) WriteErrors added in v0.9.0

func (w *Writer) WriteErrors() uint32

func (*Writer) WritePoint added in v0.9.0

func (w *Writer) WritePoint(metric string, value float64, timestamp int64)

func (*Writer) WritePointTagged added in v0.10.1

func (w *Writer) WritePointTagged(metric []string, value float64, timestamp int64)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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