This commit is contained in:
2026-06-12 06:11:57 +00:00
parent dc0410c9e4
commit 58db58a0a0
14 changed files with 1305 additions and 1227 deletions

34
qb.go
View File

@@ -26,16 +26,18 @@ const (
type TimestampCompressor interface {
// (tmp, timestamp)
Evaluate([]byte, uint32) TimeEvaluationReport
// (offset, change, timestamp)
// (rewindOffset, change, timestamp)
Append(int, []byte, uint32)
Size() int
//Chunks() [][]byte
//DeleteLast()
CaptureState() TimeDeltaCapturedState
CaptureState()
// (offset) => payload
Tail(int) []byte
CreateDecompressor() TimestampDecompressor
//Payload() []byte // для снапшота
// Offset() int
Rotate([]byte)
ReplaceBuffer([]byte)
WritePayloadTo(io.Writer, *TimeDeltaCapturedState) error
LastTimestamp() uint32
ReplaceSinceWithUntil() uint32
@@ -49,25 +51,28 @@ type TimeDeltaCapturedState struct {
}
type TimeEvaluationReport struct {
TotalSpace int
Offset int
ChangeSize int
TotalSpace int
Offset int // from payload start
RewindOffset int // steps to back from pos
ChangeSize int
}
type ValueCompressor interface {
// (tmp, value)
Evaluate([]byte, float64) ValueEvaluationReport
// (offset, change, value, delta)
// (rewindOffset, change, value, delta)
Append(int, []byte, float64, uint64)
Size() int
//Chunks() [][]byte
//DeleteLast()
CaptureState() ValueDeltaCapturedState
CaptureState()
// (offset) => payload
Tail(int) []byte
// fracDigits
CreateDecompressor() ValueDecompressor
CreateDecompressor(MetricType, byte) ValueDecompressor
//Payload() []byte // для снапшота
//Offset() int
Rotate([]byte)
ReplaceBuffer([]byte)
WritePayloadTo(io.Writer, *ValueDeltaCapturedState) error
LastValue() float64
}
@@ -79,10 +84,11 @@ type ValueDeltaCapturedState struct {
}
type ValueEvaluationReport struct {
TotalSpace int
Offset int
ChangeSize int
Delta uint64
TotalSpace int
Offset int // from payload start
RewindOffset int // steps to back from pos
ChangeSize int
Delta uint64
}
type TimestampDecompressor interface {