public HttpSpanCollector(string baseUrl, HttpSpanCollectorConfig config) { queue = new BlockingCollection <Span>(config.QueueSize); for (int i = 1; i <= config.NrOfThreads; i++) { var spanProcessor = new SpanProcessor(baseUrl, queue, config); processors.Add(spanProcessor); tasks.Add(Task.Factory.StartNew <int>(spanProcessor.Execute, cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default)); } }
/// <summary> /// /// </summary> /// <param name="baseUrl">Zipkin query service host</param> /// <param name="queue">BlockingCollection that will provide spans</param> /// <param name="config"></param> /// <param name="logger"></param> public SpanProcessor(string baseUrl, BlockingCollection <Span> queue, HttpSpanCollectorConfig config) { if (string.IsNullOrEmpty(baseUrl)) { throw new ArgumentNullException("baseUrl"); } if (queue == null) { throw new ArgumentNullException("queue"); } this.url = baseUrl + (baseUrl.EndsWith("/") ? "" : "/") + "api/v1/spans"; this.queue = queue; this.config = config; }