Exemple #1
0
        public void GlobalSetup()
        {
            this.server = TestHttpServer.RunServer(
                (ctx) =>
            {
                using (Stream receiveStream = ctx.Request.InputStream)
                {
                    while (true)
                    {
                        if (receiveStream.Read(this.buffer, 0, this.buffer.Length) == 0)
                        {
                            break;
                        }
                    }
                }

                ctx.Response.StatusCode = 200;
                ctx.Response.OutputStream.Close();
            },
                out this.serverHost,
                out this.serverPort);

            var options = new OtlpExporterOptions
            {
                Endpoint = new Uri($"http://{this.serverHost}:{this.serverPort}"),
            };

            this.exporter = new OtlpTraceExporter(
                options,
                new OtlpHttpTraceExportClient(options, options.HttpClientFactory()));

            this.activity      = ActivityHelper.CreateTestActivity();
            this.activityBatch = new CircularBuffer <Activity>(this.NumberOfSpans);
        }
 public void GlobalSetup()
 {
     this.exporter = new OtlpTraceExporter(
         new OtlpExporterOptions(),
         new NoopTraceServiceClient());
     this.activity      = ActivityHelper.CreateTestActivity();
     this.activityBatch = new CircularBuffer <Activity>(this.NumberOfSpans);
 }
Exemple #3
0
        public void GlobalSetup()
        {
            var mockClient = new Mock <OtlpCollector.TraceService.TraceServiceClient>();

            mockClient
            .Setup(m => m.Export(
                       It.IsAny <OtlpCollector.ExportTraceServiceRequest>(),
                       It.IsAny <Metadata>(),
                       It.IsAny <DateTime?>(),
                       It.IsAny <CancellationToken>()))
            .Returns(new OtlpCollector.ExportTraceServiceResponse());

            var options = new OtlpExporterOptions();

            this.exporter = new OtlpTraceExporter(
                options,
                new OtlpGrpcTraceExportClient(options, mockClient.Object));

            this.activity      = ActivityHelper.CreateTestActivity();
            this.activityBatch = new CircularBuffer <Activity>(this.NumberOfSpans);
        }
        public void GlobalSetup()
        {
            this.activity      = ActivityHelper.CreateTestActivity();
            this.activityBatch = new CircularBuffer <Activity>(this.NumberOfSpans);
            this.server        = TestHttpServer.RunServer(
                (ctx) =>
            {
                using (Stream receiveStream = ctx.Request.InputStream)
                {
                    while (true)
                    {
                        if (receiveStream.Read(this.buffer, 0, this.buffer.Length) == 0)
                        {
                            break;
                        }
                    }
                }

                ctx.Response.StatusCode = 200;
                ctx.Response.OutputStream.Close();
            },
                out this.serverHost,
                out this.serverPort);
        }
Exemple #5
0
 public void GlobalSetup()
 {
     this.activity      = ActivityHelper.CreateTestActivity();
     this.activityBatch = new CircularBuffer <Activity>(this.NumberOfSpans);
 }
 public void GlobalSetup()
 {
     this.activity      = ActivityHelper.CreateTestActivity();
     this.activityBatch = new CircularBuffer <Activity>(this.NumberOfSpans);
     this.client        = new NoopTraceServiceClient();
 }