diff --git a/cmd/frostfs-node/config.go b/cmd/frostfs-node/config.go index b3c1892f7..ef626350b 100644 --- a/cmd/frostfs-node/config.go +++ b/cmd/frostfs-node/config.go @@ -808,7 +808,7 @@ func (c *cfg) getSubstorageOpts(shCfg shardCfg) []blobstor.SubStorage { if c.metricsCollector != nil { blobTreeOpts = append(blobTreeOpts, blobovniczatree.WithMetrics( - lsmetrics.NewBlobovniczaTreeMetrics(sRead.path, c.metricsCollector.BlobobvnizcaTreeMetrics()), + lsmetrics.NewBlobovniczaTreeMetrics(sRead.path, c.metricsCollector.BlobovniczaTreeMetrics()), ), ) } diff --git a/pkg/local_object_storage/blobovnicza/blobovnicza_test.go b/pkg/local_object_storage/blobovnicza/blobovnicza_test.go index 8d701ae5c..7fe6a7657 100644 --- a/pkg/local_object_storage/blobovnicza/blobovnicza_test.go +++ b/pkg/local_object_storage/blobovnicza/blobovnicza_test.go @@ -97,7 +97,7 @@ func TestBlobovnicza(t *testing.T) { testPutGet(t, blz, oidtest.Address(), objSizeLim, nil, nil) } - // blobovnizca accepts object event if full + // blobovnicza accepts object event if full testPutGet(t, blz, oidtest.Address(), 1024, func(err error) bool { return err == nil }, nil) diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/control.go b/pkg/local_object_storage/blobstor/blobovniczatree/control.go index d993767b7..722ec0002 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/control.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/control.go @@ -50,7 +50,7 @@ func (b *Blobovniczas) Close() error { b.dbCache.Close() // order important b.activeDBManager.Close() b.commondbManager.Close() - + b.metrics.Close() return nil } diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/put.go b/pkg/local_object_storage/blobstor/blobovniczatree/put.go index 6f9c8c0de..a02fef13e 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/put.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/put.go @@ -15,7 +15,7 @@ import ( "go.uber.org/zap" ) -// Put saves object in the maximum weight blobobnicza. +// Put saves object in the maximum weight blobovnicza. // // returns error if could not save object in any blobovnicza. func (b *Blobovniczas) Put(ctx context.Context, prm common.PutPrm) (common.PutRes, error) { diff --git a/pkg/local_object_storage/metrics/blobovnicza.go b/pkg/local_object_storage/metrics/blobovnicza.go index 0d0318b3b..16f21cf44 100644 --- a/pkg/local_object_storage/metrics/blobovnicza.go +++ b/pkg/local_object_storage/metrics/blobovnicza.go @@ -8,7 +8,7 @@ import ( metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" ) -func NewBlobovniczaTreeMetrics(path string, m metrics_impl.BlobobvnizcaMetrics) blobovniczatree.Metrics { +func NewBlobovniczaTreeMetrics(path string, m metrics_impl.BlobovniczaMetrics) blobovniczatree.Metrics { return &blobovniczaTreeMetrics{ path: path, shardID: undefined, @@ -19,7 +19,7 @@ func NewBlobovniczaTreeMetrics(path string, m metrics_impl.BlobobvnizcaMetrics) type blobovniczaTreeMetrics struct { shardID string path string - m metrics_impl.BlobobvnizcaMetrics + m metrics_impl.BlobovniczaMetrics } func (m *blobovniczaTreeMetrics) Blobovnicza() blobovnicza.Metrics { @@ -35,48 +35,48 @@ func (m *blobovniczaTreeMetrics) SetParentID(parentID string) { } func (m *blobovniczaTreeMetrics) SetMode(readOnly bool) { - m.m.SetBlobobvnizcaTreeMode(m.shardID, m.path, readOnly) + m.m.SetBlobovniczaTreeMode(m.shardID, m.path, readOnly) } func (m *blobovniczaTreeMetrics) Close() { - m.m.CloseBlobobvnizcaTree(m.shardID, m.path) + m.m.CloseBlobovniczaTree(m.shardID, m.path) } func (m *blobovniczaTreeMetrics) Delete(d time.Duration, success, withStorageID bool) { - m.m.BlobobvnizcaTreeMethodDuration(m.shardID, m.path, "Delete", d, success, metrics_impl.NullBool{Valid: true, Bool: withStorageID}) + m.m.BlobovniczaTreeMethodDuration(m.shardID, m.path, "Delete", d, success, metrics_impl.NullBool{Valid: true, Bool: withStorageID}) } func (m *blobovniczaTreeMetrics) Exists(d time.Duration, success, withStorageID bool) { - m.m.BlobobvnizcaTreeMethodDuration(m.shardID, m.path, "Exists", d, success, metrics_impl.NullBool{Valid: true, Bool: withStorageID}) + m.m.BlobovniczaTreeMethodDuration(m.shardID, m.path, "Exists", d, success, metrics_impl.NullBool{Valid: true, Bool: withStorageID}) } func (m *blobovniczaTreeMetrics) GetRange(d time.Duration, size int, success, withStorageID bool) { - m.m.BlobobvnizcaTreeMethodDuration(m.shardID, m.path, "GetRange", d, success, metrics_impl.NullBool{Valid: true, Bool: withStorageID}) + m.m.BlobovniczaTreeMethodDuration(m.shardID, m.path, "GetRange", d, success, metrics_impl.NullBool{Valid: true, Bool: withStorageID}) if success { - m.m.AddBlobobvnizcaTreeGet(m.shardID, m.path, size) + m.m.AddBlobovniczaTreeGet(m.shardID, m.path, size) } } func (m *blobovniczaTreeMetrics) Get(d time.Duration, size int, success, withStorageID bool) { - m.m.BlobobvnizcaTreeMethodDuration(m.shardID, m.path, "Get", d, success, metrics_impl.NullBool{Valid: true, Bool: withStorageID}) + m.m.BlobovniczaTreeMethodDuration(m.shardID, m.path, "Get", d, success, metrics_impl.NullBool{Valid: true, Bool: withStorageID}) if success { - m.m.AddBlobobvnizcaTreeGet(m.shardID, m.path, size) + m.m.AddBlobovniczaTreeGet(m.shardID, m.path, size) } } func (m *blobovniczaTreeMetrics) Iterate(d time.Duration, success bool) { - m.m.BlobobvnizcaTreeMethodDuration(m.shardID, m.path, "Iterate", d, success, metrics_impl.NullBool{}) + m.m.BlobovniczaTreeMethodDuration(m.shardID, m.path, "Iterate", d, success, metrics_impl.NullBool{}) } func (m *blobovniczaTreeMetrics) Put(d time.Duration, size int, success bool) { - m.m.BlobobvnizcaTreeMethodDuration(m.shardID, m.path, "Put", d, success, metrics_impl.NullBool{}) + m.m.BlobovniczaTreeMethodDuration(m.shardID, m.path, "Put", d, success, metrics_impl.NullBool{}) if success { - m.m.AddBlobobvnizcaTreePut(m.shardID, m.path, size) + m.m.AddBlobovniczaTreePut(m.shardID, m.path, size) } } type blobovniczaMetrics struct { - m metrics_impl.BlobobvnizcaMetrics + m metrics_impl.BlobovniczaMetrics shardID func() string path string } diff --git a/pkg/metrics/blobovnicza.go b/pkg/metrics/blobovnicza.go index a1ecbc700..7179a1bc4 100644 --- a/pkg/metrics/blobovnicza.go +++ b/pkg/metrics/blobovnicza.go @@ -8,12 +8,12 @@ import ( "github.com/prometheus/client_golang/prometheus" ) -type BlobobvnizcaMetrics interface { - SetBlobobvnizcaTreeMode(shardID, path string, readOnly bool) - CloseBlobobvnizcaTree(shardID, path string) - BlobobvnizcaTreeMethodDuration(shardID, path string, method string, d time.Duration, success bool, withStorageID NullBool) - AddBlobobvnizcaTreePut(shardID, path string, size int) - AddBlobobvnizcaTreeGet(shardID, path string, size int) +type BlobovniczaMetrics interface { + SetBlobovniczaTreeMode(shardID, path string, readOnly bool) + CloseBlobovniczaTree(shardID, path string) + BlobovniczaTreeMethodDuration(shardID, path string, method string, d time.Duration, success bool, withStorageID NullBool) + AddBlobovniczaTreePut(shardID, path string, size int) + AddBlobovniczaTreeGet(shardID, path string, size int) AddOpenBlobovniczaSize(shardID, path string, size uint64) SubOpenBlobovniczaSize(shardID, path string, size uint64) @@ -78,11 +78,11 @@ func newBlobovnicza() *blobovnicza { } } -func (b *blobovnicza) SetBlobobvnizcaTreeMode(shardID, path string, readOnly bool) { +func (b *blobovnicza) SetBlobovniczaTreeMode(shardID, path string, readOnly bool) { b.treeMode.SetMode(shardID, path, modeFromBool(readOnly)) } -func (b *blobovnicza) CloseBlobobvnizcaTree(shardID, path string) { +func (b *blobovnicza) CloseBlobovniczaTree(shardID, path string) { b.treeMode.SetMode(shardID, path, closedMode) b.treeReqDuration.DeletePartialMatch(prometheus.Labels{ shardIDLabel: shardID, @@ -96,9 +96,21 @@ func (b *blobovnicza) CloseBlobobvnizcaTree(shardID, path string) { shardIDLabel: shardID, pathLabel: path, }) + b.treeOpenSize.DeletePartialMatch(prometheus.Labels{ + shardIDLabel: shardID, + pathLabel: path, + }) + b.treeOpenItems.DeletePartialMatch(prometheus.Labels{ + shardIDLabel: shardID, + pathLabel: path, + }) + b.treeOpenCounter.DeletePartialMatch(prometheus.Labels{ + shardIDLabel: shardID, + pathLabel: path, + }) } -func (b *blobovnicza) BlobobvnizcaTreeMethodDuration(shardID, path string, method string, d time.Duration, success bool, withStorageID NullBool) { +func (b *blobovnicza) BlobovniczaTreeMethodDuration(shardID, path string, method string, d time.Duration, success bool, withStorageID NullBool) { b.treeReqDuration.With(prometheus.Labels{ shardIDLabel: shardID, pathLabel: path, @@ -108,14 +120,14 @@ func (b *blobovnicza) BlobobvnizcaTreeMethodDuration(shardID, path string, metho }).Observe(d.Seconds()) } -func (b *blobovnicza) AddBlobobvnizcaTreePut(shardID, path string, size int) { +func (b *blobovnicza) AddBlobovniczaTreePut(shardID, path string, size int) { b.treePut.With(prometheus.Labels{ shardIDLabel: shardID, pathLabel: path, }).Add(float64(size)) } -func (b *blobovnicza) AddBlobobvnizcaTreeGet(shardID, path string, size int) { +func (b *blobovnicza) AddBlobovniczaTreeGet(shardID, path string, size int) { b.treeGet.With(prometheus.Labels{ shardIDLabel: shardID, pathLabel: path, diff --git a/pkg/metrics/node.go b/pkg/metrics/node.go index 04952f654..8e82207aa 100644 --- a/pkg/metrics/node.go +++ b/pkg/metrics/node.go @@ -16,7 +16,7 @@ type NodeMetrics struct { epoch prometheus.Gauge fstree *fstreeMetrics blobstore *blobstoreMetrics - blobobvnizca *blobovnicza + blobovnicza *blobovnicza metabase *metabaseMetrics pilorama *piloramaMetrics grpc *grpcServerMetrics @@ -40,17 +40,17 @@ func NewNodeMetrics() *NodeMetrics { Name: "epoch", Help: "Current epoch as seen by inner-ring node.", }), - fstree: newFSTreeMetrics(), - blobstore: newBlobstoreMetrics(), - blobobvnizca: newBlobovnicza(), - metabase: newMetabaseMetrics(), - pilorama: newPiloramaMetrics(), - grpc: newGrpcServerMetrics(), - policer: newPolicerMetrics(), - morphClient: newMorphClientMetrics(), - morphCache: newMorphCacheMetrics(namespace), - log: logger.NewLogMetrics(namespace), - blobTree: newBlobTreeMetrics(), + fstree: newFSTreeMetrics(), + blobstore: newBlobstoreMetrics(), + blobovnicza: newBlobovnicza(), + metabase: newMetabaseMetrics(), + pilorama: newPiloramaMetrics(), + grpc: newGrpcServerMetrics(), + policer: newPolicerMetrics(), + morphClient: newMorphClientMetrics(), + morphCache: newMorphCacheMetrics(namespace), + log: logger.NewLogMetrics(namespace), + blobTree: newBlobTreeMetrics(), } } @@ -87,8 +87,8 @@ func (m *NodeMetrics) Blobstore() BlobstoreMetrics { return m.blobstore } -func (m *NodeMetrics) BlobobvnizcaTreeMetrics() BlobobvnizcaMetrics { - return m.blobobvnizca +func (m *NodeMetrics) BlobovniczaTreeMetrics() BlobovniczaMetrics { + return m.blobovnicza } func (m *NodeMetrics) MetabaseMetrics() MetabaseMetrics {