@@ -9,14 +9,14 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal;
9
9
10
10
internal readonly struct MetricsContext
11
11
{
12
- public MetricsContext ( bool connectionDurationEnabled , bool currentNegotiatedConnectionsCounterEnabled )
12
+ public MetricsContext ( bool connectionDurationEnabled , bool currentConnectionsCounterEnabled )
13
13
{
14
14
ConnectionDurationEnabled = connectionDurationEnabled ;
15
- CurrentNegotiatedConnectionsCounterEnabled = currentNegotiatedConnectionsCounterEnabled ;
15
+ CurrentConnectionsCounterEnabled = currentConnectionsCounterEnabled ;
16
16
}
17
17
18
18
public bool ConnectionDurationEnabled { get ; }
19
- public bool CurrentNegotiatedConnectionsCounterEnabled { get ; }
19
+ public bool CurrentConnectionsCounterEnabled { get ; }
20
20
}
21
21
22
22
internal sealed class HttpConnectionsMetrics : IDisposable
@@ -25,7 +25,7 @@ internal sealed class HttpConnectionsMetrics : IDisposable
25
25
26
26
private readonly Meter _meter ;
27
27
private readonly Histogram < double > _connectionDuration ;
28
- private readonly UpDownCounter < long > _currentNegotiatedConnectionsCounter ;
28
+ private readonly UpDownCounter < long > _currentConnectionsCounter ;
29
29
30
30
public HttpConnectionsMetrics ( IMeterFactory meterFactory )
31
31
{
@@ -36,9 +36,9 @@ public HttpConnectionsMetrics(IMeterFactory meterFactory)
36
36
unit : "s" ,
37
37
description : "The duration of connections on the server." ) ;
38
38
39
- _currentNegotiatedConnectionsCounter = _meter . CreateUpDownCounter < long > (
40
- "signalr-http-transport-current-negotiated- connections" ,
41
- description : "Number of negotiated connections that are currently active on the server." ) ;
39
+ _currentConnectionsCounter = _meter . CreateUpDownCounter < long > (
40
+ "signalr-http-transport-current-connections" ,
41
+ description : "Number of connections that are currently active on the server." ) ;
42
42
}
43
43
44
44
public void ConnectionStop ( in MetricsContext metricsContext , HttpTransportType transportType , HttpConnectionStopStatus status , long startTimestamp , long currentTimestamp )
@@ -57,21 +57,21 @@ public void ConnectionTransportStart(in MetricsContext metricsContext, HttpTrans
57
57
Debug . Assert ( transportType != HttpTransportType . None ) ;
58
58
59
59
// Tags must match transport end.
60
- if ( metricsContext . CurrentNegotiatedConnectionsCounterEnabled )
60
+ if ( metricsContext . CurrentConnectionsCounterEnabled )
61
61
{
62
- _currentNegotiatedConnectionsCounter . Add ( 1 , new KeyValuePair < string , object ? > ( "transport" , transportType . ToString ( ) ) ) ;
62
+ _currentConnectionsCounter . Add ( 1 , new KeyValuePair < string , object ? > ( "transport" , transportType . ToString ( ) ) ) ;
63
63
}
64
64
}
65
65
66
66
public void TransportStop ( in MetricsContext metricsContext , HttpTransportType transportType )
67
67
{
68
- if ( metricsContext . CurrentNegotiatedConnectionsCounterEnabled )
68
+ if ( metricsContext . CurrentConnectionsCounterEnabled )
69
69
{
70
70
// Tags must match transport start.
71
71
// If the transport type is none then the transport was never started for this connection.
72
72
if ( transportType != HttpTransportType . None )
73
73
{
74
- _currentNegotiatedConnectionsCounter . Add ( - 1 , new KeyValuePair < string , object ? > ( "transport" , transportType . ToString ( ) ) ) ;
74
+ _currentConnectionsCounter . Add ( - 1 , new KeyValuePair < string , object ? > ( "transport" , transportType . ToString ( ) ) ) ;
75
75
}
76
76
}
77
77
}
@@ -83,6 +83,6 @@ public void Dispose()
83
83
84
84
public MetricsContext CreateContext ( )
85
85
{
86
- return new MetricsContext ( _connectionDuration . Enabled , _currentNegotiatedConnectionsCounter . Enabled ) ;
86
+ return new MetricsContext ( _connectionDuration . Enabled , _currentConnectionsCounter . Enabled ) ;
87
87
}
88
88
}
0 commit comments