From ab48dee695fc06649b069460904629667ef158b7 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 13 Dec 2016 22:26:40 +0100 Subject: [PATCH 1/2] Update go-ds-measure to 1.1.0 License: MIT Signed-off-by: Jakub Sztandera --- package.json | 4 ++-- repo/fsrepo/defaultds.go | 2 +- repo/fsrepo/fsrepo.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index c4e5282e806..fad38b1a090 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 428ea510b25..ad35afa9778 100644 --- a/repo/fsrepo/defaultds.go +++ b/repo/fsrepo/defaultds.go @@ -9,9 +9,9 @@ import ( "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" + "gx/ipfs/QmbUSMTQtK9GRrUbD4ngqJwSzHsquUc8nyDubRWp4vPybH/go-ds-measure" "gx/ipfs/Qmbx2KUs8mUbDUiiESzC1ms7mdmh4pRu8X1V1tffC46M4n/go-ds-flatfs" ) diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 79c8ddbf1b6..fab4f2b97d1 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") From 4016f4031127ca4d1250fb81b8ea01e270333405 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 13 Dec 2016 22:32:37 +0100 Subject: [PATCH 2/2] repo: remove nodeid from the metrics It was there because old collector was using debug env to report metrics and there keys have to very unique. As we are reporting it now to prometheus it is better to have it under the same key as we had before. License: MIT Signed-off-by: Jakub Sztandera --- repo/fsrepo/defaultds.go | 6 ++++-- repo/fsrepo/fsrepo.go | 12 +----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/repo/fsrepo/defaultds.go b/repo/fsrepo/defaultds.go index ad35afa9778..e7b1503d8b2 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" levelds "gx/ipfs/QmaHHmfEozrrotyhyN44omJouyuEtx6ahddqV6W5yRaUSQ/go-ds-leveldb" ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt" - "gx/ipfs/QmbUSMTQtK9GRrUbD4ngqJwSzHsquUc8nyDubRWp4vPybH/go-ds-measure" + 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 fab4f2b97d1..629281b9883 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -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