コード例 #1
0
        static void RunUdp()
        {
            var processor = new InfluxBulkInsertProcessor("Server=192.168.2.120;Port=8089;BitchSize=10", InfluxInsertProtocol.Udp);

            processor.Open();
            for (int i = 0; i < 1000; i++)
            {
                processor.Write($"test,type='cpu' value={i} {InfluxdbTimeGen.GenNanosecond()}");
            }
            Console.WriteLine("Complete udp");
            processor.Close();
        }
コード例 #2
0
        static void RunHttp()
        {
            var processor = new InfluxBulkInsertProcessor("Server=192.168.2.120;Port=8086;BitchSize=50;Database=kong;Timeout=30;", InfluxInsertProtocol.Http);

            processor.Open();
            for (int i = 0; i < 1000; i++)
            {
                processor.Write($"test,type='cpu' value=1 {InfluxdbTimeGen.GenNanosecond()}");
            }

            Console.WriteLine("Complete http");
            processor.Close();
        }