From c425b1d848130905199495c2db71f2760f0f5b72 Mon Sep 17 00:00:00 2001 From: gfanton <8671905+gfanton@users.noreply.github.com> Date: Tue, 1 Mar 2022 15:02:28 +0100 Subject: [PATCH] chore: remove unused stat struct Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com> --- stores/basestore/base_store.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/stores/basestore/base_store.go b/stores/basestore/base_store.go index 6f771a7c..93020851 100644 --- a/stores/basestore/base_store.go +++ b/stores/basestore/base_store.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "sync" - "sync/atomic" "time" ipfslog "berty.tech/go-ipfs-log" @@ -48,12 +47,7 @@ type BaseStore struct { replicator replicator.Replicator index iface.StoreIndex replicationStatus replicator.ReplicationInfo - stats struct { - snapshot struct { - bytesLoaded int64 - } - syncRequestsReceived int64 - } + referenceCount int replicate bool directory string @@ -184,8 +178,6 @@ func (b *BaseStore) InitBaseStore(ctx context.Context, ipfs coreapi.CoreAPI, ide b.index = options.Index(b.Identity().PublicKey) b.muIndex.Unlock() - atomic.StoreInt64(&b.stats.snapshot.bytesLoaded, -1) - b.replicator = replicator.NewReplicator(ctx, b, options.ReplicationConcurrency, &replicator.Options{ Logger: b.logger, Tracer: b.tracer, @@ -257,10 +249,6 @@ func (b *BaseStore) Close() error { // Reset replication statistics b.ReplicationStatus().Reset() - // Reset database statistics - atomic.StoreInt64(&b.stats.snapshot.bytesLoaded, -1) - atomic.StoreInt64(&b.stats.syncRequestsReceived, 0) - b.UnsubscribeAll() err := b.Cache().Close() @@ -452,8 +440,6 @@ func (b *BaseStore) Sync(ctx context.Context, heads []ipfslog.Entry) error { ctx, span := b.tracer.Start(ctx, "store-sync") defer span.End() - atomic.AddInt64(&b.stats.syncRequestsReceived, 1) - if len(heads) == 0 { return nil }