Add new bufferPool implementation

This commit is contained in:
Aditya Ujeniya
2026-02-27 14:44:32 +01:00
parent a418abc7d5
commit 07b989cb81
4 changed files with 155 additions and 4 deletions

View File

@@ -42,6 +42,7 @@ package metricstore
import (
"sync"
"time"
"unsafe"
"github.com/ClusterCockpit/cc-lib/v2/schema"
@@ -192,6 +193,7 @@ func (l *Level) free(t int64) (int, error) {
if cap(b.data) != BufferCap {
b.data = make([]schema.Float, 0, BufferCap)
}
b.lastUsed = time.Now().Unix()
bufferPool.Put(b)
l.metrics[i] = nil
}