From 770327cf646227ec901f55edcd652e000465fc40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Pa=C3=9F?= <22845248+mpass99@users.noreply.github.com> Date: Sat, 6 Aug 2022 13:13:46 +0200 Subject: [PATCH] Add storage count debug statement. --- pkg/storage/storage.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/storage/storage.go b/pkg/storage/storage.go index 63380e4..ad70d3c 100644 --- a/pkg/storage/storage.go +++ b/pkg/storage/storage.go @@ -3,11 +3,14 @@ package storage import ( influxdb2 "github.com/influxdata/influxdb-client-go/v2" "github.com/influxdata/influxdb-client-go/v2/api/write" + "github.com/openHPI/poseidon/pkg/logging" "github.com/openHPI/poseidon/pkg/monitoring" "strconv" "sync" ) +var log = logging.GetLogger("storage") + // Storage is an interface for storing objects. type Storage[T any] interface { // List returns all objects from the storage. @@ -135,7 +138,9 @@ func (s *localStorage[T]) Length() uint { } func (s *localStorage[T]) unsafeLength() uint { - return uint(len(s.objects)) + length := len(s.objects) + log.WithField("length_int", length).WithField("length_uint", uint(length)).Debug("Storage info") + return uint(length) } func (s *localStorage[T]) sendMonitoringData(id string, o T, isDeletion bool, count uint) {