public void NoopTagger() { ITagger noopTagger = NoopTags.NoopTagger; Assert.Same(NoopTags.NoopTagContext, noopTagger.Empty); Assert.Same(NoopTags.NoopTagContext, noopTagger.CurrentTagContext); Assert.Same(NoopTags.NoopTagContextBuilder, noopTagger.EmptyBuilder); Assert.Same(NoopTags.NoopTagContextBuilder, noopTagger.ToBuilder(TAG_CONTEXT)); Assert.Same(NoopTags.NoopTagContextBuilder, noopTagger.CurrentBuilder); Assert.Same(NoopScope.Instance, noopTagger.WithTagContext(TAG_CONTEXT)); }
/// <summary> /// Create tags with context and put to metrics /// </summary> /// <param name="context"></param> /// <returns></returns> ITagContext CreateTag(ServiceContext context) { return(tagger.ToBuilder(defaultTags).Put(MethodKey, TagValue.Create(context.CallContext.Method)).Build()); }
public void NoopTagger_ToBuilder_DisallowsNull() { ITagger noopTagger = NoopTags.NoopTagger; Assert.Throws <ArgumentNullException>(() => noopTagger.ToBuilder(null)); }