public void CheckExportedOnEnd()
        {
            using var exporter  = new TestActivityExporter();
            using var processor = new SimpleExportActivityProcessor(exporter);

            processor.OnEnd(new Activity("start1"));
            Assert.Single(exporter.Exported);

            processor.OnEnd(new Activity("start2"));
            Assert.Equal(2, exporter.Exported.Count);
        }
        public void CheckForceFlushExport(int timeout)
        {
            using var exporter  = new TestActivityExporter();
            using var processor = new SimpleExportActivityProcessor(exporter);

            processor.OnEnd(new Activity("start1"));
            processor.OnEnd(new Activity("start2"));

            // checking before force flush
            Assert.Equal(2, exporter.Exported.Count);

            // forcing flush
            processor.ForceFlush(timeout);
            Assert.Equal(2, exporter.Exported.Count);
        }
        public void CheckShutdownExport(int timeout)
        {
            using var exporter  = new TestActivityExporter();
            using var processor = new SimpleExportActivityProcessor(exporter);

            processor.OnEnd(new Activity("start"));

            // checking before shutdown
            Assert.Single(exporter.Exported);

            processor.Shutdown(timeout);
            Assert.Single(exporter.Exported);
        }
Ejemplo n.º 4
0
        public void ZipkinExporter_Export()
        {
            var zipkinExporter = new ZipkinExporter(
                new ZipkinExporterOptions
            {
                Endpoint = new Uri($"http://{this.serverHost}:{this.serverPort}"),
            });
            var processor = new SimpleExportActivityProcessor(zipkinExporter);

            for (int i = 0; i < this.NumberOfActivities; i++)
            {
                processor.OnEnd(this.testActivity);
            }
        }