コード例 #1
0
        public async void Write(string database, InfluxDB.Net.Models.Point point, StatusCallBack statusCallBack)
        {
            //基于InfluxData.Net.InfluxDb.Models.Point实体准备数据
            //var point = new Point()
            //{
            //    Measurement = "logs",//表名
            //    Tags = new Dictionary<string, object>()
            //    {
            //       { "Id", 158}
            //    },
            //    Fields = new Dictionary<string, object>()
            //    {
            //       { "Val", "webInfo" }
            //    },
            //    Timestamp = DateTime.UtcNow
            //};
            InfluxDbApiResponse writeResponse = await _client.WriteAsync(database, point);

            statusCallBack?.Invoke(writeResponse.Success);
        }
コード例 #2
0
        public async System.Threading.Tasks.Task <string> WriteAsync(string database, InfluxDB.Net.Models.Point point, StatusCallBack statusCallBack)
        {
            InfluxDbApiResponse writeResponse = await _client.WriteAsync(database, point);

            statusCallBack?.Invoke(writeResponse.Success);
            return(writeResponse.Success ? "入库成功" : "入库失败");
        }