From 0480507a10bcb67a2fa21ae9376fe14802e1edcc Mon Sep 17 00:00:00 2001 From: Pascal Fischer <32096965+pascal-fischer@users.noreply.github.com> Date: Sat, 28 Jun 2025 11:38:15 +0200 Subject: [PATCH] [management] report networkmap duration in ms (#4064) --- management/server/telemetry/updatechannel_metrics.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/management/server/telemetry/updatechannel_metrics.go b/management/server/telemetry/updatechannel_metrics.go index 21b4a6085..2b280b352 100644 --- a/management/server/telemetry/updatechannel_metrics.go +++ b/management/server/telemetry/updatechannel_metrics.go @@ -19,7 +19,7 @@ type UpdateChannelMetrics struct { getAllConnectedPeers metric.Int64Histogram hasChannelDurationMicro metric.Int64Histogram calcPostureChecksDurationMicro metric.Int64Histogram - calcPeerNetworkMapDurationMicro metric.Int64Histogram + calcPeerNetworkMapDurationMs metric.Int64Histogram mergeNetworkMapDurationMicro metric.Int64Histogram toSyncResponseDurationMicro metric.Int64Histogram ctx context.Context @@ -101,8 +101,8 @@ func NewUpdateChannelMetrics(ctx context.Context, meter metric.Meter) (*UpdateCh return nil, err } - calcPeerNetworkMapDurationMicro, err := meter.Int64Histogram("management.updatechannel.calc.networkmap.duration.micro", - metric.WithUnit("microseconds"), + calcPeerNetworkMapDurationMs, err := meter.Int64Histogram("management.updatechannel.calc.networkmap.duration.ms", + metric.WithUnit("milliseconds"), metric.WithDescription("Duration of how long it takes to calculate the network map for a peer"), ) if err != nil { @@ -135,7 +135,7 @@ func NewUpdateChannelMetrics(ctx context.Context, meter metric.Meter) (*UpdateCh getAllConnectedPeers: getAllConnectedPeers, hasChannelDurationMicro: hasChannelDurationMicro, calcPostureChecksDurationMicro: calcPostureChecksDurationMicro, - calcPeerNetworkMapDurationMicro: calcPeerNetworkMapDurationMicro, + calcPeerNetworkMapDurationMs: calcPeerNetworkMapDurationMs, mergeNetworkMapDurationMicro: mergeNetworkMapDurationMicro, toSyncResponseDurationMicro: toSyncResponseDurationMicro, ctx: ctx, @@ -183,7 +183,7 @@ func (metrics *UpdateChannelMetrics) CountCalcPostureChecksDuration(duration tim } func (metrics *UpdateChannelMetrics) CountCalcPeerNetworkMapDuration(duration time.Duration) { - metrics.calcPeerNetworkMapDurationMicro.Record(metrics.ctx, duration.Microseconds()) + metrics.calcPeerNetworkMapDurationMs.Record(metrics.ctx, duration.Milliseconds()) } func (metrics *UpdateChannelMetrics) CountMergeNetworkMapDuration(duration time.Duration) {