Skip to content

Commit

Permalink
Merge pull request #90 from gfanton/fix/remove-store-stats
Browse files Browse the repository at this point in the history
  • Loading branch information
gfanton authored Mar 1, 2022
2 parents 32a047f + c425b1d commit 21c33ff
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions stores/basestore/base_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"sync"
"sync/atomic"
"time"

ipfslog "berty.tech/go-ipfs-log"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 21c33ff

Please sign in to comment.