wp
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package transform
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
bin "gordenko.dev/dima/bin/little"
|
||||
@@ -102,7 +101,7 @@ type CumulativeMeasureWriter struct {
|
||||
}
|
||||
|
||||
func NewCumulativeMeasureWriter(dst io.Writer, since uint32) *CumulativeMeasureWriter {
|
||||
fmt.Println("NewCumulativeMeasureWriter")
|
||||
//fmt.Println("NewCumulativeMeasureWriter")
|
||||
// 20 - это timestamp, value, total
|
||||
return &CumulativeMeasureWriter{
|
||||
arr: make([]byte, 20),
|
||||
@@ -128,13 +127,13 @@ func (s *CumulativeMeasureWriter) feed(timestamp uint32, value float64, isBuffer
|
||||
s.responder.AppendRecord(s.arr)
|
||||
}
|
||||
}
|
||||
fmt.Println("feed:", timestamp, value, isBuffer)
|
||||
//fmt.Println("feed:", timestamp, value, isBuffer)
|
||||
s.endTimestamp = timestamp
|
||||
s.endValue = value
|
||||
}
|
||||
|
||||
func (s *CumulativeMeasureWriter) pack(total float64) {
|
||||
fmt.Println("PACK")
|
||||
//fmt.Println("PACK")
|
||||
bin.PutUint32(s.arr[0:], s.endTimestamp)
|
||||
bin.PutFloat64(s.arr[4:], s.endValue)
|
||||
bin.PutFloat64(s.arr[12:], total)
|
||||
|
||||
Reference in New Issue
Block a user