fix: repair references to removed utils package

nwaku_test_utils.go now uses pkg/kernel/utils.GetRSSKB; the memory_record
tool is self-contained (local helpers, missing mutex restored).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Igor Sirotin 2026-06-10 12:07:46 +03:00
parent 7d8c57b44c
commit 3c419ced16
No known key found for this signature in database
GPG Key ID: 0EABBCB40CB9AD4A
2 changed files with 7 additions and 7 deletions

View File

@ -18,7 +18,7 @@ import (
"github.com/libp2p/go-libp2p/core/peer"
"github.com/logos-messaging/logos-delivery-go-bindings/pkg/kernel/common"
"github.com/logos-messaging/logos-delivery-go-bindings/pkg/kernel/pb"
"github.com/logos-messaging/logos-delivery-go-bindings/utils"
"github.com/logos-messaging/logos-delivery-go-bindings/pkg/kernel/utils"
"google.golang.org/protobuf/proto"
)

View File

@ -9,15 +9,15 @@ import (
"runtime"
"strconv"
"strings"
"sync"
"time"
"github.com/logos-messaging/logos-delivery-go-bindings/utils"
)
var (
testName string
iteration int
phase string
mu sync.Mutex
)
func main() {
@ -30,13 +30,13 @@ func main() {
runtime.ReadMemStats(&memStats)
heapKB := memStats.HeapAlloc / 1024
rssKB, err := utils.GetRSSKB()
rssKB, err := GetRSSKB()
if err != nil {
fmt.Fprintln(os.Stderr, "Failed to get RSS:", err)
rssKB = 0
}
if err := utils.RecordMemoryMetricsCSV(testName, iteration, phase, heapKB, rssKB); err != nil {
if err := RecordMemoryMetricsCSV(testName, iteration, phase, heapKB, rssKB); err != nil {
fmt.Fprintln(os.Stderr, "Error recording metrics:", err)
os.Exit(1)
}
@ -50,7 +50,7 @@ func RecordMemoryMetricsCSV(testName string, iter int, phase string, heapKB, rss
if err != nil {
return err
}
defer f.Close()
defer func() { _ = f.Close() }()
w := csv.NewWriter(f)
defer w.Flush()
@ -83,7 +83,7 @@ func GetRSSKB() (uint64, error) {
if err != nil {
return 0, err
}
defer f.Close()
defer func() { _ = f.Close() }()
data, err := io.ReadAll(f)
if err != nil {
return 0, err