コード例 #1
0
        public void CanSendManyMetrics()
        {
            var random = new Random();

            while (random.Next() > 0)
            {
                var client = new GraphiteClient(GraphiteHost, new PickleGraphiteFormatter());
                client.Send("test.client.random1", random.NextDouble() * 100);
                client = new GraphiteClient(GraphiteHost, new PlaintextGraphiteFormatter());
                client.Send("test.client.random2", random.NextDouble() * 100);
                Thread.Sleep(500);
            }
            CarbonConnectionPool.ClearAllPools();
        }
コード例 #2
0
        public async Task CanSendManyMetricsAsync()
        {
            var random = new Random();

            while (random.Next() > 0)
            {
                var client = new GraphiteClient(GraphiteHost, new PickleGraphiteFormatter());
                await client.SendAsync("test.client.random1", random.NextDouble() * 100);

                client = new GraphiteClient(GraphiteHost, new PlaintextGraphiteFormatter());
                await client.SendAsync("test.client.random2", random.NextDouble() * 100);

                await Task.Delay(500);
            }
            CarbonConnectionPool.ClearAllPools();
        }