@@ -40,7 +40,6 @@ public void Start_Stop_IsRunning()
40
40
Assert . False ( _metricServer . IsRunning ) ;
41
41
}
42
42
43
-
44
43
[ Fact ]
45
44
public void Start_DoubleStop_IsRunning ( )
46
45
{
@@ -73,7 +72,6 @@ public void Start_Stop_WithDefaultPort_IsRunning()
73
72
Assert . False ( _metricServer . IsRunning ) ;
74
73
}
75
74
76
-
77
75
[ Fact ]
78
76
public void Start_Stop_WithDefaultRegisry_IsRunning ( )
79
77
{
@@ -93,7 +91,7 @@ public async Task BaseMapPath_FindMetrics()
93
91
var counter = Metrics . DefaultFactory . CreateCounter ( "test_counter" , "help" ) ;
94
92
counter . Inc ( ) ;
95
93
using var httpClient = new HttpClient ( ) ;
96
- string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } /metrics ") ;
94
+ string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } { Defaults . MapPath } ") ;
97
95
Assert . False ( string . IsNullOrEmpty ( response ) ) ;
98
96
Assert . Contains ( "process_private_memory_bytes" , response ) ;
99
97
Assert . Contains ( "dotnet_total_memory_bytes" , response ) ;
@@ -136,8 +134,8 @@ public async Task SetMapPath_FindMetricsWithEndSlash()
136
134
}
137
135
138
136
[ Theory ]
137
+ [ InlineData ( Defaults . MapPath ) ]
139
138
[ InlineData ( "metrics" ) ]
140
- [ InlineData ( "/metrics" ) ]
141
139
[ InlineData ( "metrics12" ) ]
142
140
[ InlineData ( "/metrics965" ) ]
143
141
public async Task SetMapPath_FindMetrics ( string mapPath )
@@ -181,7 +179,7 @@ public async Task CustomCounter_FindMetric()
181
179
counter . Inc ( ) ;
182
180
183
181
using var httpClient = new HttpClient ( ) ;
184
- string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } /metrics ") ;
182
+ string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } { Defaults . MapPath } ") ;
185
183
Assert . Contains ( metricName , response ) ;
186
184
}
187
185
catch ( Exception ex )
@@ -202,7 +200,7 @@ public async Task AddLegacyMetrics_False_FindMetrics()
202
200
{
203
201
_metricServer . Start ( ) ;
204
202
using var httpClient = new HttpClient ( ) ;
205
- string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } /metrics ") ;
203
+ string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } { Defaults . MapPath } ") ;
206
204
Assert . Contains ( "process_private_memory_bytes" , response ) ;
207
205
Assert . Contains ( "dotnet_total_memory_bytes" , response ) ;
208
206
Assert . DoesNotContain ( "process_private_bytes" , response ) ;
@@ -228,7 +226,7 @@ public async Task AddLegacyMetrics_True_FindMetrics()
228
226
{
229
227
_metricServer . Start ( ) ;
230
228
using var httpClient = new HttpClient ( ) ;
231
- string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } /metrics ") ;
229
+ string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } { Defaults . MapPath } ") ;
232
230
Assert . Contains ( "process_private_memory_bytes" , response ) ;
233
231
Assert . Contains ( "dotnet_total_memory_bytes" , response ) ;
234
232
Assert . Contains ( "process_private_bytes" , response ) ;
@@ -285,7 +283,7 @@ public async Task CustormEncoding_FindHelp()
285
283
counter . Inc ( ) ;
286
284
287
285
using var httpClient = new HttpClient ( ) ;
288
- string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } /metrics ") ;
286
+ string response = await httpClient . GetStringAsync ( $ "http://localhost:{ _port } { Defaults . MapPath } ") ;
289
287
Assert . Contains ( help , response ) ;
290
288
}
291
289
catch ( Exception ex )
0 commit comments