mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2025-06-18 05:23:49 +02:00
Fix to avro reader
This commit is contained in:
parent
0fe634ec45
commit
d00bfc6b9c
@ -536,10 +536,11 @@ func (l *Level) loadAvroFile(m *MemoryStore, f *os.File, from int64) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Level) createBuffer(m *MemoryStore, metricName string, floatArray util.FloatArray, from int64, resolution int64) error {
|
func (l *Level) createBuffer(m *MemoryStore, metricName string, floatArray util.FloatArray, from int64, resolution int64) error {
|
||||||
|
n := len(floatArray)
|
||||||
b := &buffer{
|
b := &buffer{
|
||||||
frequency: resolution,
|
frequency: resolution,
|
||||||
start: from,
|
start: from,
|
||||||
data: floatArray,
|
data: floatArray[0:n:n],
|
||||||
prev: nil,
|
prev: nil,
|
||||||
next: nil,
|
next: nil,
|
||||||
archived: true,
|
archived: true,
|
||||||
@ -570,6 +571,8 @@ func (l *Level) createBuffer(m *MemoryStore, metricName string, floatArray util.
|
|||||||
for range missingCount {
|
for range missingCount {
|
||||||
prev.data = append(prev.data, util.NaN)
|
prev.data = append(prev.data, util.NaN)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prev.data = prev.data[0:len(prev.data):len(prev.data)]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
l.metrics[minfo.Offset] = b
|
l.metrics[minfo.Offset] = b
|
||||||
|
Loading…
x
Reference in New Issue
Block a user