From 81ea91de52956ff0db8fe31728a172ab7f2b7711 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 24 Jun 2024 17:12:26 +0300 Subject: [PATCH] [#451] metrics: Move to internal `metrics` don't look like something others want to import. Signed-off-by: Dmitrii Stepanov --- cmd/frostfs-ir/main.go | 2 +- cmd/frostfs-node/config.go | 2 +- cmd/frostfs-node/netmap.go | 2 +- {pkg => internal}/metrics/blobovnicza.go | 0 {pkg => internal}/metrics/blobstore.go | 0 {pkg => internal}/metrics/consts.go | 0 {pkg => internal}/metrics/engine.go | 0 {pkg => internal}/metrics/fstree.go | 0 {pkg => internal}/metrics/gc.go | 0 {pkg => internal}/metrics/grpc.go | 0 {pkg => internal}/metrics/innerring.go | 0 {pkg => internal}/metrics/metabase.go | 0 {pkg => internal}/metrics/mode.go | 0 {pkg => internal}/metrics/morph.go | 0 {pkg => internal}/metrics/morphcache.go | 0 {pkg => internal}/metrics/node.go | 0 {pkg => internal}/metrics/object.go | 0 {pkg => internal}/metrics/pilorama.go | 0 {pkg => internal}/metrics/policer.go | 0 {pkg => internal}/metrics/replicator.go | 0 {pkg => internal}/metrics/state.go | 0 {pkg => internal}/metrics/treeservice.go | 0 {pkg => internal}/metrics/types.go | 0 {pkg => internal}/metrics/writecache.go | 0 pkg/innerring/innerring.go | 2 +- pkg/local_object_storage/engine/metrics.go | 2 +- pkg/local_object_storage/engine/writecache.go | 2 +- pkg/local_object_storage/metrics/blobovnicza.go | 2 +- pkg/local_object_storage/metrics/blobstore.go | 2 +- pkg/local_object_storage/metrics/fstree.go | 2 +- pkg/local_object_storage/metrics/metabase.go | 2 +- pkg/local_object_storage/metrics/pilorama.go | 2 +- pkg/morph/client/client.go | 2 +- pkg/morph/client/constructor.go | 2 +- scripts/export-metrics/main.go | 2 +- 35 files changed, 14 insertions(+), 14 deletions(-) rename {pkg => internal}/metrics/blobovnicza.go (100%) rename {pkg => internal}/metrics/blobstore.go (100%) rename {pkg => internal}/metrics/consts.go (100%) rename {pkg => internal}/metrics/engine.go (100%) rename {pkg => internal}/metrics/fstree.go (100%) rename {pkg => internal}/metrics/gc.go (100%) rename {pkg => internal}/metrics/grpc.go (100%) rename {pkg => internal}/metrics/innerring.go (100%) rename {pkg => internal}/metrics/metabase.go (100%) rename {pkg => internal}/metrics/mode.go (100%) rename {pkg => internal}/metrics/morph.go (100%) rename {pkg => internal}/metrics/morphcache.go (100%) rename {pkg => internal}/metrics/node.go (100%) rename {pkg => internal}/metrics/object.go (100%) rename {pkg => internal}/metrics/pilorama.go (100%) rename {pkg => internal}/metrics/policer.go (100%) rename {pkg => internal}/metrics/replicator.go (100%) rename {pkg => internal}/metrics/state.go (100%) rename {pkg => internal}/metrics/treeservice.go (100%) rename {pkg => internal}/metrics/types.go (100%) rename {pkg => internal}/metrics/writecache.go (100%) diff --git a/cmd/frostfs-ir/main.go b/cmd/frostfs-ir/main.go index 206059b5..5b852c37 100644 --- a/cmd/frostfs-ir/main.go +++ b/cmd/frostfs-ir/main.go @@ -9,9 +9,9 @@ import ( "sync/atomic" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" + irMetrics "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/misc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring" - irMetrics "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger" "github.com/spf13/viper" "go.uber.org/zap" diff --git a/cmd/frostfs-node/config.go b/cmd/frostfs-node/config.go index 2b185cfc..ef2c0424 100644 --- a/cmd/frostfs-node/config.go +++ b/cmd/frostfs-node/config.go @@ -31,6 +31,7 @@ import ( replicatorconfig "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/replicator" tracingconfig "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/tracing" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" + "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/ape/chainbase" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" frostfsidcore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/frostfsid" @@ -45,7 +46,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard" shardmode "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/writecache" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client" containerClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/container" nmClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/netmap" diff --git a/cmd/frostfs-node/netmap.go b/cmd/frostfs-node/netmap.go index 2d424eec..d2c0af52 100644 --- a/cmd/frostfs-node/netmap.go +++ b/cmd/frostfs-node/netmap.go @@ -10,8 +10,8 @@ import ( netmapGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" + "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" nmClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/netmap" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event" netmapEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event/netmap" diff --git a/pkg/metrics/blobovnicza.go b/internal/metrics/blobovnicza.go similarity index 100% rename from pkg/metrics/blobovnicza.go rename to internal/metrics/blobovnicza.go diff --git a/pkg/metrics/blobstore.go b/internal/metrics/blobstore.go similarity index 100% rename from pkg/metrics/blobstore.go rename to internal/metrics/blobstore.go diff --git a/pkg/metrics/consts.go b/internal/metrics/consts.go similarity index 100% rename from pkg/metrics/consts.go rename to internal/metrics/consts.go diff --git a/pkg/metrics/engine.go b/internal/metrics/engine.go similarity index 100% rename from pkg/metrics/engine.go rename to internal/metrics/engine.go diff --git a/pkg/metrics/fstree.go b/internal/metrics/fstree.go similarity index 100% rename from pkg/metrics/fstree.go rename to internal/metrics/fstree.go diff --git a/pkg/metrics/gc.go b/internal/metrics/gc.go similarity index 100% rename from pkg/metrics/gc.go rename to internal/metrics/gc.go diff --git a/pkg/metrics/grpc.go b/internal/metrics/grpc.go similarity index 100% rename from pkg/metrics/grpc.go rename to internal/metrics/grpc.go diff --git a/pkg/metrics/innerring.go b/internal/metrics/innerring.go similarity index 100% rename from pkg/metrics/innerring.go rename to internal/metrics/innerring.go diff --git a/pkg/metrics/metabase.go b/internal/metrics/metabase.go similarity index 100% rename from pkg/metrics/metabase.go rename to internal/metrics/metabase.go diff --git a/pkg/metrics/mode.go b/internal/metrics/mode.go similarity index 100% rename from pkg/metrics/mode.go rename to internal/metrics/mode.go diff --git a/pkg/metrics/morph.go b/internal/metrics/morph.go similarity index 100% rename from pkg/metrics/morph.go rename to internal/metrics/morph.go diff --git a/pkg/metrics/morphcache.go b/internal/metrics/morphcache.go similarity index 100% rename from pkg/metrics/morphcache.go rename to internal/metrics/morphcache.go diff --git a/pkg/metrics/node.go b/internal/metrics/node.go similarity index 100% rename from pkg/metrics/node.go rename to internal/metrics/node.go diff --git a/pkg/metrics/object.go b/internal/metrics/object.go similarity index 100% rename from pkg/metrics/object.go rename to internal/metrics/object.go diff --git a/pkg/metrics/pilorama.go b/internal/metrics/pilorama.go similarity index 100% rename from pkg/metrics/pilorama.go rename to internal/metrics/pilorama.go diff --git a/pkg/metrics/policer.go b/internal/metrics/policer.go similarity index 100% rename from pkg/metrics/policer.go rename to internal/metrics/policer.go diff --git a/pkg/metrics/replicator.go b/internal/metrics/replicator.go similarity index 100% rename from pkg/metrics/replicator.go rename to internal/metrics/replicator.go diff --git a/pkg/metrics/state.go b/internal/metrics/state.go similarity index 100% rename from pkg/metrics/state.go rename to internal/metrics/state.go diff --git a/pkg/metrics/treeservice.go b/internal/metrics/treeservice.go similarity index 100% rename from pkg/metrics/treeservice.go rename to internal/metrics/treeservice.go diff --git a/pkg/metrics/types.go b/internal/metrics/types.go similarity index 100% rename from pkg/metrics/types.go rename to internal/metrics/types.go diff --git a/pkg/metrics/writecache.go b/internal/metrics/writecache.go similarity index 100% rename from pkg/metrics/writecache.go rename to internal/metrics/writecache.go diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index 944aa8b7..50a37845 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -8,12 +8,12 @@ import ( "sync/atomic" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" + "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/config" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/alphabet" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/governance" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/netmap" timerEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/timers" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client" balanceClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/balance" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/container" diff --git a/pkg/local_object_storage/engine/metrics.go b/pkg/local_object_storage/engine/metrics.go index 6b99dff7..72b5ae25 100644 --- a/pkg/local_object_storage/engine/metrics.go +++ b/pkg/local_object_storage/engine/metrics.go @@ -3,8 +3,8 @@ package engine import ( "time" + "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" ) type MetricRegister interface { diff --git a/pkg/local_object_storage/engine/writecache.go b/pkg/local_object_storage/engine/writecache.go index 02357671..da488260 100644 --- a/pkg/local_object_storage/engine/writecache.go +++ b/pkg/local_object_storage/engine/writecache.go @@ -5,10 +5,10 @@ import ( "sync" "time" + "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/writecache" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" "git.frostfs.info/TrueCloudLab/frostfs-observability/tracing" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" diff --git a/pkg/local_object_storage/metrics/blobovnicza.go b/pkg/local_object_storage/metrics/blobovnicza.go index 6886bbc1..460d6e63 100644 --- a/pkg/local_object_storage/metrics/blobovnicza.go +++ b/pkg/local_object_storage/metrics/blobovnicza.go @@ -3,10 +3,10 @@ package metrics import ( "time" + metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobovnicza" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/blobovniczatree" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode" - metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" ) func NewBlobovniczaTreeMetrics(path string, m metrics_impl.BlobobvnizcaMetrics) blobovniczatree.Metrics { diff --git a/pkg/local_object_storage/metrics/blobstore.go b/pkg/local_object_storage/metrics/blobstore.go index b3871dfc..9a41f01d 100644 --- a/pkg/local_object_storage/metrics/blobstore.go +++ b/pkg/local_object_storage/metrics/blobstore.go @@ -3,8 +3,8 @@ package metrics import ( "time" + metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor" - metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" ) type blobstoreMetrics struct { diff --git a/pkg/local_object_storage/metrics/fstree.go b/pkg/local_object_storage/metrics/fstree.go index e6b3175b..76822ac2 100644 --- a/pkg/local_object_storage/metrics/fstree.go +++ b/pkg/local_object_storage/metrics/fstree.go @@ -3,9 +3,9 @@ package metrics import ( "time" + metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/fstree" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode" - metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" ) func NewFSTreeMetricsWithoutShardID(path string, m metrics_impl.FSTreeMetrics) fstree.Metrics { diff --git a/pkg/local_object_storage/metrics/metabase.go b/pkg/local_object_storage/metrics/metabase.go index 1a02f270..e962e37c 100644 --- a/pkg/local_object_storage/metrics/metabase.go +++ b/pkg/local_object_storage/metrics/metabase.go @@ -3,9 +3,9 @@ package metrics import ( "time" + metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" meta "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/metabase" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode" - metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" ) func NewMetabaseMetrics(path string, m metrics_impl.MetabaseMetrics) meta.Metrics { diff --git a/pkg/local_object_storage/metrics/pilorama.go b/pkg/local_object_storage/metrics/pilorama.go index 1b715c2b..050b769a 100644 --- a/pkg/local_object_storage/metrics/pilorama.go +++ b/pkg/local_object_storage/metrics/pilorama.go @@ -3,9 +3,9 @@ package metrics import ( "time" + metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/pilorama" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode" - metrics_impl "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" ) func NewPiloramaMetrics(m metrics_impl.PiloramaMetrics) pilorama.Metrics { diff --git a/pkg/morph/client/client.go b/pkg/morph/client/client.go index c9f819f0..df521f56 100644 --- a/pkg/morph/client/client.go +++ b/pkg/morph/client/client.go @@ -10,7 +10,7 @@ import ( "time" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" + "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" morphmetrics "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger" "github.com/google/uuid" diff --git a/pkg/morph/client/constructor.go b/pkg/morph/client/constructor.go index c499aa89..648c7d3c 100644 --- a/pkg/morph/client/constructor.go +++ b/pkg/morph/client/constructor.go @@ -7,7 +7,7 @@ import ( "time" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" + "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" morphmetrics "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/metrics" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger" lru "github.com/hashicorp/golang-lru/v2" diff --git a/scripts/export-metrics/main.go b/scripts/export-metrics/main.go index 63571e96..51705ee4 100644 --- a/scripts/export-metrics/main.go +++ b/scripts/export-metrics/main.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - local_metrics "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics" + local_metrics "git.frostfs.info/TrueCloudLab/frostfs-node/internal/metrics" "git.frostfs.info/TrueCloudLab/frostfs-observability/metrics" )