Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2020-08-13 12:10:35 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-08-17 13:19:24 +0300
commit534f05289ae1dfae09e18abb597374b93f5147fb (patch)
treebeb4e5b97ba5cb6c0c6fe2b198928f3832403c68 /internal/praefect/coordinator_test.go
parentd4ab5ef2168db11f97918ceab78f3c7503e4db80 (diff)
transactions: Setup metrics in transaction manager
Right now, setup of metrics used in the transaction manager is split across multiple locations. This makes the process of adding new metrics more involved than it needs to be and is a source of bugs in case any of those locations is not updated. Improve the situation by moving setup of metrics into the transaction manager. Metrics are exposed by implementing the Collector interface and registering the transaction manager itself as a metric.
Diffstat (limited to 'internal/praefect/coordinator_test.go')
-rw-r--r--internal/praefect/coordinator_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/praefect/coordinator_test.go b/internal/praefect/coordinator_test.go
index e8a4644f4..134360901 100644
--- a/internal/praefect/coordinator_test.go
+++ b/internal/praefect/coordinator_test.go
@@ -92,7 +92,7 @@ func TestStreamDirectorReadOnlyEnforcement(t *testing.T) {
}},
}, nil
}},
- transactions.NewManager(),
+ transactions.NewManager(conf),
conf,
protoregistry.GitalyProtoPreregistered,
)
@@ -155,7 +155,7 @@ func TestStreamDirectorMutator(t *testing.T) {
require.NoError(t, err)
nodeMgr.Start(0, time.Hour)
- txMgr := transactions.NewManager()
+ txMgr := transactions.NewManager(conf)
coordinator := NewCoordinator(
queueInterceptor,
@@ -357,7 +357,7 @@ func TestStreamDirectorMutator_Transaction(t *testing.T) {
waitNodeToChangeHealthStatus(ctx, t, node, true)
}
- txMgr := transactions.NewManager()
+ txMgr := transactions.NewManager(conf)
// set up the generations prior to transaction
rs := datastore.NewMemoryRepositoryStore(conf.StorageNames())
@@ -494,7 +494,7 @@ func TestStreamDirectorAccessor(t *testing.T) {
require.NoError(t, err)
nodeMgr.Start(0, time.Minute)
- txMgr := transactions.NewManager()
+ txMgr := transactions.NewManager(conf)
coordinator := NewCoordinator(
queue,
@@ -583,7 +583,7 @@ func TestCoordinatorStreamDirector_distributesReads(t *testing.T) {
require.NoError(t, err)
nodeMgr.Start(0, time.Minute)
- txMgr := transactions.NewManager()
+ txMgr := transactions.NewManager(conf)
coordinator := NewCoordinator(
queue,
@@ -782,7 +782,7 @@ func TestAbsentCorrelationID(t *testing.T) {
require.NoError(t, err)
nodeMgr.Start(0, time.Hour)
- txMgr := transactions.NewManager()
+ txMgr := transactions.NewManager(conf)
coordinator := NewCoordinator(
queueInterceptor,