コード例 #1
0
        public void ItShouldBeAbleToSendMessagesOfArbitraryLength(char ch, int count)
        {
            var config = new StatsDConfiguration
            {
                Host = "127.0.0.1"
            };

            var fakeTransport = new FakeTransport();
            var publisher     = new BufferBasedStatsDPublisher(config, fakeTransport);

            publisher.Increment(new string(ch, count));
            fakeTransport.TimesCalled.ShouldBe(1);
        }
コード例 #2
0
        public void Setup()
        {
            var config = new StatsDConfiguration
            {
                // if you want to verify that stats are received,
                // you will need the IP of suitable local test stats server
                Host   = "127.0.0.1",
                Prefix = "testmetric"
            };

            var endpointSource = EndpointParser.MakeEndPointSource(
                config.Host,
                config.Port,
                config.DnsLookupInterval);

            _transport = new SocketTransport(endpointSource, SocketProtocol.Udp);

            _adaptedStatsDPublisher = new StatsDPublisher(config);
            _adaptedStatsDPublisher.Increment("startup.ud");

            _udpSender = new BufferBasedStatsDPublisher(config, _transport);
            _udpSender.Increment("startup.ud");
        }
コード例 #3
0
 public BufferBasedStatsDPublisherTests()
 {
     _sut = new BufferBasedStatsDPublisher(_configuration, _transport);
 }