예제 #1
0
        public void CheckShutdownExport(int timeout)
        {
            using var exporter  = new TestActivityExporter();
            using var processor = new SimpleExportProcessor <Activity>(exporter);

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

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

            processor.Shutdown(timeout);
            Assert.Single(exporter.Exported);
        }
예제 #2
0
        public void CheckShutdownExport(int timeout)
        {
            var exported = new List <object>();

            using var exporter  = new InMemoryExporter <Activity>(new InMemoryExporterOptions { ExportedItems = exported });
            using var processor = new SimpleExportProcessor <Activity>(exporter);

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

            // checking before shutdown
            Assert.Single(exported);

            processor.Shutdown(timeout);
            Assert.Single(exported);
        }
        public void CheckShutdownExport(int timeout)
        {
            var exportedItems = new List <Activity>();

            using var exporter  = new InMemoryExporter <Activity>(exportedItems);
            using var processor = new SimpleExportProcessor <Activity>(exporter);

            var activity = new Activity("start");

            activity.ActivityTraceFlags = ActivityTraceFlags.Recorded;

            processor.OnEnd(activity);

            // checking before shutdown
            Assert.Single(exportedItems);

            processor.Shutdown(timeout);
            Assert.Single(exportedItems);
        }