public void set_prefix_on_stats_name_when_calling_send() { var s = new Statsd(_udp, "a.prefix."); s.SendInteger(IntegralMetric.Counter, "counter", 5); s.SendInteger(IntegralMetric.Counter, "counter", 5); _udp.AssertWasCalled(x => x.Send("a.prefix.counter:5|c"), x => x.Repeat.Twice()); }
public void timing_with_value_of_X_and_sample_rate() { var s = new Statsd(_udp, SampleEverything); s.SendInteger(IntegralMetric.Timer, "timer", 5, 0.1); _udp.AssertWasCalled(x => x.Send("timer:5|ms|@0.1")); }
public void adds_timing() { var s = new Statsd(_udp, SampleEverything); s.SendInteger(IntegralMetric.Timer, "timer", 5); _udp.AssertWasCalled(x => x.Send("timer:5|ms")); }
public void increases_counter_with_value_of_X_and_sample_rate() { var s = new Statsd(_udp, SampleEverything); s.SendInteger(IntegralMetric.Counter, "counter", 5, 0.1); _udp.AssertWasCalled(x => x.Send("counter:5|c|@0.1")); }
public void adds_histogram() { var s = new Statsd(_udp, SampleEverything); s.SendInteger(IntegralMetric.Histogram, "histogram", 5); _udp.AssertWasCalled(x => x.Send("histogram:5|h")); }
public void adds_meter() { var s = new Statsd(_udp, SampleEverything); s.SendInteger(IntegralMetric.Meter, "meter", 5); _udp.AssertWasCalled(x => x.Send("meter:5|m")); }
public void timing_exception_fails_silently() { _udp.Stub(x => x.Send(Arg <string> .Is.Anything)).Throw(new Exception()); var s = new Statsd(_udp); s.SendInteger(IntegralMetric.Timer, "timer", 5); Assert.Pass(); }
public void counting_exception_fails_silently() { var s = new Statsd(_udp, SampleEverything); _udp.Stub(x => x.Send(Arg <string> .Is.Anything)).Throw(new Exception()); s.SendInteger(IntegralMetric.Counter, "counter", 5); Assert.Pass(); }
public void histrogram_exception_fails_silently() { _udp.Stub(x => x.Send(Arg <string> .Is.Anything)).Throw(new Exception()); var s = new Statsd(_udp); s.SendInteger(IntegralMetric.Histogram, "histogram", 5); Assert.Pass(); }
public void add_one_counter_and_send_one_timer_sends_only_sends_the_last() { var s = new Statsd(_udp, SampleEverything); s.AddInteger(IntegralMetric.Counter, "counter", 1); s.SendInteger(IntegralMetric.Timer, "timer", 1); _udp.AssertWasCalled(x => x.Send("timer:1|ms")); }