mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-30 22:50:22 +02:00
[management] report networkmap duration in ms (#4064)
This commit is contained in:
@ -19,7 +19,7 @@ type UpdateChannelMetrics struct {
|
|||||||
getAllConnectedPeers metric.Int64Histogram
|
getAllConnectedPeers metric.Int64Histogram
|
||||||
hasChannelDurationMicro metric.Int64Histogram
|
hasChannelDurationMicro metric.Int64Histogram
|
||||||
calcPostureChecksDurationMicro metric.Int64Histogram
|
calcPostureChecksDurationMicro metric.Int64Histogram
|
||||||
calcPeerNetworkMapDurationMicro metric.Int64Histogram
|
calcPeerNetworkMapDurationMs metric.Int64Histogram
|
||||||
mergeNetworkMapDurationMicro metric.Int64Histogram
|
mergeNetworkMapDurationMicro metric.Int64Histogram
|
||||||
toSyncResponseDurationMicro metric.Int64Histogram
|
toSyncResponseDurationMicro metric.Int64Histogram
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
@ -101,8 +101,8 @@ func NewUpdateChannelMetrics(ctx context.Context, meter metric.Meter) (*UpdateCh
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
calcPeerNetworkMapDurationMicro, err := meter.Int64Histogram("management.updatechannel.calc.networkmap.duration.micro",
|
calcPeerNetworkMapDurationMs, err := meter.Int64Histogram("management.updatechannel.calc.networkmap.duration.ms",
|
||||||
metric.WithUnit("microseconds"),
|
metric.WithUnit("milliseconds"),
|
||||||
metric.WithDescription("Duration of how long it takes to calculate the network map for a peer"),
|
metric.WithDescription("Duration of how long it takes to calculate the network map for a peer"),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -135,7 +135,7 @@ func NewUpdateChannelMetrics(ctx context.Context, meter metric.Meter) (*UpdateCh
|
|||||||
getAllConnectedPeers: getAllConnectedPeers,
|
getAllConnectedPeers: getAllConnectedPeers,
|
||||||
hasChannelDurationMicro: hasChannelDurationMicro,
|
hasChannelDurationMicro: hasChannelDurationMicro,
|
||||||
calcPostureChecksDurationMicro: calcPostureChecksDurationMicro,
|
calcPostureChecksDurationMicro: calcPostureChecksDurationMicro,
|
||||||
calcPeerNetworkMapDurationMicro: calcPeerNetworkMapDurationMicro,
|
calcPeerNetworkMapDurationMs: calcPeerNetworkMapDurationMs,
|
||||||
mergeNetworkMapDurationMicro: mergeNetworkMapDurationMicro,
|
mergeNetworkMapDurationMicro: mergeNetworkMapDurationMicro,
|
||||||
toSyncResponseDurationMicro: toSyncResponseDurationMicro,
|
toSyncResponseDurationMicro: toSyncResponseDurationMicro,
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
@ -183,7 +183,7 @@ func (metrics *UpdateChannelMetrics) CountCalcPostureChecksDuration(duration tim
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (metrics *UpdateChannelMetrics) CountCalcPeerNetworkMapDuration(duration time.Duration) {
|
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) {
|
func (metrics *UpdateChannelMetrics) CountMergeNetworkMapDuration(duration time.Duration) {
|
||||||
|
Reference in New Issue
Block a user