diff --git a/package.json b/package.json index c4e5282e8..fad38b1a0 100644 --- a/package.json +++ b/package.json @@ -219,9 +219,9 @@ }, { "author": "whyrusleeping", - "hash": "Qma2gYZ4F7ftPMPve1RvbNJS45R3Y2qoYDtibH8MrwXAv4", + "hash": "QmbUSMTQtK9GRrUbD4ngqJwSzHsquUc8nyDubRWp4vPybH", "name": "go-ds-measure", - "version": "1.0.3" + "version": "1.1.0" }, { "author": "whyrusleeping", diff --git a/repo/fsrepo/defaultds.go b/repo/fsrepo/defaultds.go index 428ea510b..e7b1503d8 100644 --- a/repo/fsrepo/defaultds.go +++ b/repo/fsrepo/defaultds.go @@ -7,11 +7,12 @@ import ( repo "github.com/ipfs/go-ipfs/repo" config "github.com/ipfs/go-ipfs/repo/config" "github.com/ipfs/go-ipfs/thirdparty/dir" + ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" mount "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/syncmount" - "gx/ipfs/Qma2gYZ4F7ftPMPve1RvbNJS45R3Y2qoYDtibH8MrwXAv4/go-ds-measure" levelds "gx/ipfs/QmaHHmfEozrrotyhyN44omJouyuEtx6ahddqV6W5yRaUSQ/go-ds-leveldb" ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt" + measure "gx/ipfs/QmbUSMTQtK9GRrUbD4ngqJwSzHsquUc8nyDubRWp4vPybH/go-ds-measure" "gx/ipfs/Qmbx2KUs8mUbDUiiESzC1ms7mdmh4pRu8X1V1tffC46M4n/go-ds-flatfs" ) @@ -48,7 +49,8 @@ func openDefaultDatastore(r *FSRepo) (repo.Datastore, error) { // the tests pass in a zero Config; cope with it id = fmt.Sprintf("uninitialized_%p", r) } - prefix := "fsrepo." + id + ".datastore." + + prefix := "ipfs.fsrepo.datastore." metricsBlocks := measure.New(prefix+"blocks", blocksDS) metricsLevelDB := measure.New(prefix+"leveldb", leveldbDS) mountDS := mount.New([]mount.Mount{ diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 79c8ddbf1..629281b98 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -22,8 +22,8 @@ import ( logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" ma "gx/ipfs/QmUAQaWbKxGCUTuoQVvvicbQNZ9APF5pDGWyAZSe93AtKH/go-multiaddr" - "gx/ipfs/Qma2gYZ4F7ftPMPve1RvbNJS45R3Y2qoYDtibH8MrwXAv4/go-ds-measure" util "gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util" + "gx/ipfs/QmbUSMTQtK9GRrUbD4ngqJwSzHsquUc8nyDubRWp4vPybH/go-ds-measure" ) var log = logging.Logger("fsrepo") @@ -365,17 +365,7 @@ func (r *FSRepo) openDatastore() error { } // Wrap it with metrics gathering - // - // Add our PeerID to metrics paths to keep them unique - // - // As some tests just pass a zero-value Config to fsrepo.Init, - // cope with missing PeerID. - id := r.config.Identity.PeerID - if id == "" { - // the tests pass in a zero Config; cope with it - id = fmt.Sprintf("uninitialized_%p", r) - } - prefix := "fsrepo." + id + ".datastore" + prefix := "ipfs.fsrepo.datastore" r.ds = measure.New(prefix, r.ds) return nil