From 76955247da6d471d7e6e7734edcc9063c5e15f72 Mon Sep 17 00:00:00 2001 From: Justin Chan Date: Fri, 13 Mar 2020 15:19:07 -0400 Subject: [PATCH] Add metric for BootstrappedAndDurable --- src/dbnode/storage/bootstrap.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dbnode/storage/bootstrap.go b/src/dbnode/storage/bootstrap.go index 9c2d3047f8..c4bed89629 100644 --- a/src/dbnode/storage/bootstrap.go +++ b/src/dbnode/storage/bootstrap.go @@ -83,6 +83,7 @@ type bootstrapManager struct { hasPending bool status tally.Gauge bootstrapDuration tally.Timer + durableStatus tally.Gauge lastBootstrapCompletionTime time.Time } @@ -102,6 +103,7 @@ func newBootstrapManager( processProvider: opts.BootstrapProcessProvider(), status: scope.Gauge("bootstrapped"), bootstrapDuration: scope.Timer("bootstrap-duration"), + durableStatus: scope.Gauge("bootstrapped-durable"), } m.bootstrapFn = m.bootstrap return m @@ -199,6 +201,12 @@ func (m *bootstrapManager) Report() { } else { m.status.Update(0) } + + if m.database.IsBootstrappedAndDurable() { + m.durableStatus.Update(1) + } else { + m.durableStatus.Update(0) + } } type bootstrapNamespace struct {