public void should_add_class_tags_to_registered_metric() { var annottated = new Annottated(); ICompositeMetric metrics = AppMetrics.RegisterObject(annottated); Assert.That(HasTag(metrics.Config.Tags, "global-tag-name"), Is.True); }
public void should_register_metric_fields() { var annottated = new Annottated(); ICompositeMetric metrics = AppMetrics.RegisterObject(annottated); Assert.That(metrics.Metrics.Count, Is.EqualTo(1)); }
IMetric GetMetricWithTag(ICompositeMetric metric, string value) { return (metric .Metrics .First( x => x.Config.Tags.FirstOrDefault(t => t.Value == value) != null)); }
public void should_add_field_tags_to_regitered_metrics() { var annottated = new Annottated(); ICompositeMetric metrics = AppMetrics.RegisterObject(annottated); IMetric timer = metrics.Metrics.First(); Assert.That(HasTag(timer.Config.Tags, "my-tag-name"), Is.True); Assert.That(HasTag(timer.Config.Tags, "my-second-tag-name"), Is.True); }
public CompositeMetricWrapper(Tags tags, ICompositeMetric composite) : base(composite.Config.WithAdditionalTags(tags)) { List <IMetric> wrapped = composite .Metrics .Select(x => Wrap(x, Config.Tags)) .ToList(); Metrics = new ReadOnlyCollection <IMetric>(wrapped); }
public CompositMetricTransformer(ICompositeMetric metric, Func <ICollection <IMetric>, ICollection <IMetric> > transform) { metric_ = metric; transform_ = transform; }
IMetric GetMetricWithTag(ICompositeMetric metric, string value) { return metric .Metrics .First( x => x.Config.Tags.FirstOrDefault(t => t.Value == value) != null); }