This is an automated email from the ASF dual-hosted git repository.
alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/develop by this push:
new ea32b5dae fix error dubbo_registry_directory metric type (#2766)
ea32b5dae is described below
commit ea32b5dae2ae9ed0e14ee4656773906f9182de3b
Author: foghost <[email protected]>
AuthorDate: Sun Dec 22 20:50:59 2024 +0800
fix error dubbo_registry_directory metric type (#2766)
---
metrics/registry/collector.go | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/metrics/registry/collector.go b/metrics/registry/collector.go
index 871dd469b..4a75e0668 100644
--- a/metrics/registry/collector.go
+++ b/metrics/registry/collector.go
@@ -97,15 +97,15 @@ func (rc *registryCollector) directoryHandler(event
*RegistryMetricsEvent) {
typ := event.Attachment["DirTyp"]
switch typ {
case NumAllInc:
- rc.R.Counter(metrics.NewMetricId(DirectoryMetricNumAll,
level)).Inc()
+ rc.R.Gauge(metrics.NewMetricId(DirectoryMetricNumAll,
level)).Inc()
case NumAllDec:
- rc.R.Counter(metrics.NewMetricId(DirectoryMetricNumAll,
level)).Add(-1)
+ rc.R.Gauge(metrics.NewMetricId(DirectoryMetricNumAll,
level)).Add(-1)
case NumDisableTotal:
- rc.R.Counter(metrics.NewMetricId(DirectoryMetricNumDisable,
level)).Inc()
+ rc.R.Gauge(metrics.NewMetricId(DirectoryMetricNumDisable,
level)).Inc()
case NumToReconnectTotal:
- rc.R.Counter(metrics.NewMetricId(DirectoryMetricNumToReconnect,
level)).Inc()
+ rc.R.Gauge(metrics.NewMetricId(DirectoryMetricNumToReconnect,
level)).Inc()
case NumValidTotal:
- rc.R.Counter(metrics.NewMetricId(DirectoryMetricNumValid,
level)).Inc()
+ rc.R.Gauge(metrics.NewMetricId(DirectoryMetricNumValid,
level)).Inc()
default:
}