@@ -100,7 +100,7 @@ public void TestFromIConfig()
100
100
}
101
101
102
102
[ Fact ]
103
- public void TestSamplerConst ( )
103
+ public void TestSamplerConstFromEnv ( )
104
104
{
105
105
SetProperty ( Configuration . JaegerSamplerType , ConstSampler . Type ) ;
106
106
SetProperty ( Configuration . JaegerSamplerParam , "1" ) ;
@@ -138,7 +138,7 @@ public void TestSamplerConstInvalidParam()
138
138
}
139
139
140
140
[ Fact ]
141
- public void TestReporterConfiguration ( )
141
+ public void TestReporterConfigurationFromEnv ( )
142
142
{
143
143
SetProperty ( Configuration . JaegerReporterLogSpans , "true" ) ;
144
144
SetProperty ( Configuration . JaegerAgentHost , "MyHost" ) ;
@@ -153,28 +153,38 @@ public void TestReporterConfiguration()
153
153
Assert . Equal ( 1000 , reporterConfig . MaxQueueSize ) ;
154
154
}
155
155
156
- [ Fact ]
157
- public void TestReporterConfigurationInvalidFlushInterval ( )
158
- {
159
- SetProperty ( Configuration . JaegerReporterFlushInterval , "X" ) ;
160
- ReporterConfiguration reporterConfig = ReporterConfiguration . FromEnv ( _loggerFactory ) ;
161
- Assert . Null ( reporterConfig . FlushInterval ) ;
162
- }
163
-
164
156
[ Fact ]
165
157
public void TestReporterConfigurationFromIConfiguration ( )
166
158
{
167
159
var arrayDict = new Dictionary < string , string >
168
160
{
169
- { Configuration . JaegerReporterLogSpans , "X" } ,
161
+ { Configuration . JaegerSamplerType , ConstSampler . Type } ,
162
+ { Configuration . JaegerSamplerParam , "1" } ,
163
+ { Configuration . JaegerReporterLogSpans , "true" } ,
164
+ { Configuration . JaegerAgentHost , "MyHost" } ,
165
+ { Configuration . JaegerAgentPort , "1234" } ,
166
+ { Configuration . JaegerReporterFlushInterval , "500" } ,
167
+ { Configuration . JaegerReporterMaxQueueSize , "1000" }
170
168
} ;
171
169
172
170
var configuration = new ConfigurationBuilder ( )
173
171
. AddInMemoryCollection ( arrayDict )
174
172
. Build ( ) ;
175
173
176
174
ReporterConfiguration reporterConfig = ReporterConfiguration . FromIConfiguration ( _loggerFactory , configuration ) ;
177
- Assert . False ( reporterConfig . LogSpans ) ;
175
+ Assert . True ( reporterConfig . LogSpans ) ;
176
+ Assert . Equal ( "MyHost" , reporterConfig . SenderConfig . AgentHost ) ;
177
+ Assert . Equal ( 1234 , reporterConfig . SenderConfig . AgentPort ) ;
178
+ Assert . Equal ( TimeSpan . FromMilliseconds ( 500 ) , reporterConfig . FlushInterval ) ;
179
+ Assert . Equal ( 1000 , reporterConfig . MaxQueueSize ) ;
180
+ }
181
+
182
+ [ Fact ]
183
+ public void TestReporterConfigurationInvalidFlushInterval ( )
184
+ {
185
+ SetProperty ( Configuration . JaegerReporterFlushInterval , "X" ) ;
186
+ ReporterConfiguration reporterConfig = ReporterConfiguration . FromEnv ( _loggerFactory ) ;
187
+ Assert . Null ( reporterConfig . FlushInterval ) ;
178
188
}
179
189
180
190
[ Fact ]
0 commit comments