Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetAggregatorFactory()

Func< Aggregator > System.Diagnostics.Metrics.AggregationManager.GetAggregatorFactory ( Instrument instrument)
inlineprivate

Definition at line 250 of file AggregationManager.cs.

251 {
252 Type type = instrument.GetType();
253 Type type2 = null;
254 type2 = (type.IsGenericType ? type.GetGenericTypeDefinition() : null);
255 if (type2 == typeof(Counter<>))
256 {
257 return delegate
258 {
259 lock (this)
260 {
261 return CheckTimeSeriesAllowed() ? new RateSumAggregator() : null;
262 }
263 };
264 }
266 {
267 return delegate
268 {
269 lock (this)
270 {
271 return CheckTimeSeriesAllowed() ? new RateAggregator() : null;
272 }
273 };
274 }
276 {
277 return delegate
278 {
279 lock (this)
280 {
281 return CheckTimeSeriesAllowed() ? new LastValue() : null;
282 }
283 };
284 }
285 if (type2 == typeof(Histogram<>))
286 {
287 return delegate
288 {
289 lock (this)
290 {
291 return (!CheckTimeSeriesAllowed() || !CheckHistogramAllowed()) ? null : new ExponentialHistogramAggregator(s_defaultHistogramConfig);
292 }
293 };
294 }
295 return null;
296 }
static readonly QuantileAggregation s_defaultHistogramConfig

References System.Diagnostics.Metrics.AggregationManager.CheckHistogramAllowed(), System.Diagnostics.Metrics.AggregationManager.CheckTimeSeriesAllowed(), System.Diagnostics.Metrics.AggregationManager.s_defaultHistogramConfig, and System.type.

Referenced by System.Diagnostics.Metrics.AggregationManager.BuildInstrumentState().