public void Should_send_message()
 {
     var statsdClient = new StatsdClient("localhost", 1234);
     var r = new Result("name", System.DateTime.Now, "path");
     r.SetValue(12);
     statsdClient.Send(r);
 }
Exemplo n.º 2
0
        public void ShouldGenerateFeatureSpecificGateOperationTimerMetricWhenTestingFeature()
        {
            Flipper.Feature("Stats").EnableActor(FlipperActor);
            Flipper.Feature("Stats").IsEnabledFor(FlipperActor);

            StatsdClient.AssertWasCalled(x => x.LogTiming(Arg <string> .Is.Equal("flipper.feature.Stats.gate_operation.boolean.open"), Arg <long> .Is.Anything));
        }
        public void TestFeatureMetricsForTestingFeature(string counterName)
        {
            Feature.IsEnabledFor(FlipperActor);

            StatsdClient.AssertWasCalled(x => x.LogTiming(Arg <string> .Is.Equal("flipper.feature_operation.enabled"), Arg <long> .Is.Anything));
            StatsdClient.AssertWasCalled(x => x.LogCount(counterName));
        }
Exemplo n.º 4
0
        public void ShouldGenerateFeatureSpecificGateOperationTimerMetricWhenTestingFeature(string gateName, string state)
        {
            Flipper.Feature("Stats").EnableActor(FlipperActor);
            Flipper.Feature("Stats").IsEnabledFor(FlipperActor);

            var expectedStatName = string.Format("flipper.feature.Stats.gate.{0}.{1}", gateName, state);

            StatsdClient.AssertWasCalled(x => x.LogCount(expectedStatName));
        }
        public void Should_create_statsd_client_uppercase()
        {
            var client = new StatsdClient { Hostname = "localhost", Port = 8125, ClientName = "STATSDCLIENT" };

            var o = clientFactory.Create(client);

            Assert.That(o, Is.Not.Null);
            Assert.That(o, Is.TypeOf(typeof(StatsdClient)));
            Assert.That(o, Is.TypeOf<StatsdClient>());
        }
Exemplo n.º 6
0
 private void SendSingle(string command)
 {
     try
     {
         StatsdClient.Send(command);
     }
     catch (Exception e)
     {
         Debug.WriteLine(e.Message);
     }
 }
Exemplo n.º 7
0
 public void Send()
 {
     try
     {
         StatsdClient.Send(string.Join("\n", Commands.ToArray()));
         Commands = new List <string>();
     }
     catch (Exception e)
     {
         Debug.WriteLine(e.Message);
     }
 }
Exemplo n.º 8
0
 public void Send()
 {
     try
     {
         StatsdClient.Send(string.Join("\n", Commands.ToArray()));
         AtomicallyClearQueue();
     }
     catch (Exception e)
     {
         Debug.WriteLine(e.Message);
     }
 }
Exemplo n.º 9
0
 private async Task SendSingleAsync(MemoryString command)
 {
     try
     {
         await StatsdClient.SendAsync(command.Memory.Span).ConfigureAwait(false);
     }
     catch (Exception e)
     {
         Debug.WriteLine(e.Message);
     }
     finally
     {
         command.Dispose();
     }
 }
 public void Should_send_message()
 {
     var statsdClient = new StatsdClient("localhost", 1234);
     statsdClient.Send(new Result(12, "name", System.DateTime.Now, "path"));
 }
Exemplo n.º 11
0
 public NumberSerialzationTest()
 {
     _channel = new LoggingChannel();
     _client  = new StatsdClient(_channel);
 }
 public PrefixedStatsdClientTests()
 {
     _channel = new LoggingChannel();
     _client  = new StatsdClient(_channel, "custom.prefix");
 }
Exemplo n.º 13
0
 public StatsdClientTests()
 {
     _channel = new LoggingChannel();
     _client  = new StatsdClient(_channel);
 }
Exemplo n.º 14
0
        public void TestAdapterMetricsForTestingFeature()
        {
            Flipper.Feature("Name").IsEnabledFor(FlipperActor);

            StatsdClient.AssertWasCalled(x => x.LogTiming(Arg <string> .Is.Equal("flipper.adapter.memory.get"), Arg <long> .Is.Anything));
        }
Exemplo n.º 15
0
        public void ShouldCreateAFeatureTimerMetricWhenDisablingFeature()
        {
            Flipper.Feature("Name").DisableActor(FlipperActor);

            StatsdClient.AssertWasCalled(x => x.LogTiming(Arg <string> .Is.Equal("flipper.adapter.memory.disable"), Arg <long> .Is.Anything));
        }
        public void ShouldCreateAFeatureTimerMetricWhenDisablingFeature()
        {
            Feature.DisableActor(FlipperActor);

            StatsdClient.AssertWasCalled(x => x.LogTiming(Arg <string> .Is.Equal("flipper.feature_operation.disable"), Arg <long> .Is.Anything));
        }