Beispiel #1
0
        public ViewManagerTest()
        {
            clock = TestClock.Create();

            statsComponent = new StatsComponent(new SimpleEventQueue(), clock);
            tagsComponent  = new TagsComponent();

            tagger        = tagsComponent.Tagger;
            viewManager   = statsComponent.ViewManager;
            statsRecorder = statsComponent.StatsRecorder;
        }
        public void TestRegisterAndGetView()
        {
            MeasureToViewMap measureToViewMap = new MeasureToViewMap();
            TestClock        clock            = TestClock.Create(Timestamp.Create(10, 20));

            measureToViewMap.RegisterView(VIEW, clock);
            clock.Time = Timestamp.Create(30, 40);
            IViewData viewData = measureToViewMap.GetView(VIEW_NAME, clock, StatsCollectionState.ENABLED);

            Assert.Equal(VIEW, viewData.View);
            Assert.Empty(viewData.AggregationMap);
        }
Beispiel #3
0
        //@Rule public readonly ExpectedException exception = ExpectedException.none();


        public SpanTest()
        {
            spanContext        = SpanContext.Create(TraceId.GenerateRandomId(random), SpanId.GenerateRandomId(random), TraceOptions.DEFAULT);
            parentSpanId       = SpanId.GenerateRandomId(random);
            testClock          = TestClock.Create(timestamp);
            timestampConverter = TimestampConverter.Now(testClock);
            attributes.Add(
                "MyStringAttributeKey", AttributeValue.StringAttributeValue("MyStringAttributeValue"));
            attributes.Add("MyLongAttributeKey", AttributeValue.LongAttributeValue(123L));
            attributes.Add("MyBooleanAttributeKey", AttributeValue.BooleanAttributeValue(false));
            expectedAttributes = new Dictionary <String, IAttributeValue>(attributes);
            expectedAttributes.Add(
                "MySingleStringAttributeKey",
                AttributeValue.StringAttributeValue("MySingleStringAttributeValue"));
        }
Beispiel #4
0
 public TracerTest()
 {
     startEndHandler = Mock.Of <IStartEndHandler>();
     traceConfig     = Mock.Of <ITraceConfig>();
     tracer          = new Tracer(new RandomGenerator(), startEndHandler, TestClock.Create(), traceConfig);
 }
 public StatsRecorderTest()
 {
     statsComponent = new StatsComponent(new SimpleEventQueue(), TestClock.Create());
     viewManager    = statsComponent.ViewManager;
     statsRecorder  = statsComponent.StatsRecorder;
 }