当前位置: 首页 > news >正文

婚礼网站建设网页浏览器怎么卸载

婚礼网站建设,网页浏览器怎么卸载,静海的做网站,wordpress引用群晖文件夹前言 使用时序数据库influxdb时,我们经常需要写入大量的数据。而单单使用influxDB.write(Point)进行单条写入时,速度过慢,无法支撑时序数据大量写入的速度。 所以我们需要采用批量的方式进行存储,增加写入…

前言

使用时序数据库influxdb时,我们经常需要写入大量的数据。而单单使用influxDB.write(Point)进行单条写入时,速度过慢,无法支撑时序数据大量写入的速度。
所以我们需要采用批量的方式进行存储,增加写入的速度。


一、使用什么方法

influxDB.write(BatchPoints batchPoints)

二、使用步骤

1.引入库

    <dependency><groupId>org.influxdb</groupId><artifactId>influxdb-java</artifactId><version>2.10</version></dependency>

2.创建influxdb连接

private static String openurl = "http://127.0.0.1:10002";//连接地址
private static String username = "admin";//用户名
private static String password = "abc_123";//密码
private static String database = "test";//数据库InfluxDB influxDB = InfluxDBFactory.connect(openurl, username, password);
influxDB.createDatabase(database);

3.创建Point

  Point point = Point.measurement(measurement).time(System.currentTimeMillis(), TimeUnit.MILLISECONDS)//tag属性——只能存储String类型.tag("label", "label")//field存储数据.addField("value", 1).addField("rt", "rt").build();

4.创建BatchPoints并添加Point

BatchPoints batchPoints = BatchPoints.database("db2019").build();
batchPoints.point(point);

5.写入influxdb

influxDB.write(batchPoints);

三、示例

package org.example.influx;import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBFactory;
import org.influxdb.dto.BatchPoints;
import org.influxdb.dto.Point;import java.util.concurrent.TimeUnit;public class InfluxDBBatchWriter243 {private static String openurl = "http://10.16.8.243:8086";//连接地址private static String username = "admin";//用户名private static String password = "douzhi+FANGFA1";//密码private static String database = "db2019";//数据库private static Point createPoint(long time){Point point = Point.measurement("test2").addField("group__tag1", "297af48c06a74220aff4fcc6bcaa44c9kg").tag("host", "changdong").time(time, TimeUnit.MILLISECONDS).build();return point;}public static void main(String[] args) throws InterruptedException {InfluxDB influxDB = InfluxDBFactory.connect(openurl, username, password);influxDB.createDatabase(database);long time1 = System.currentTimeMillis();while (true) {BatchPoints batchPoints = BatchPoints.database("db2019").build();//将单条数据存储到集合中for (int i = 0; i < 1000; i++) {time1 = time1 + 1;batchPoints.point(createPoint(time1));}long startTime = System.currentTimeMillis();influxDB.write(batchPoints);long endTime = System.currentTimeMillis();System.out.println("当前时间:" +endTime+ ", 写入时间:" +time1+ ", 写入用时" + (endTime - startTime) + "毫秒");Thread.sleep(1010);}}
}
http://www.yayakq.cn/news/596824/

相关文章:

  • 网站原创内容wordpress用户组名称
  • 沈阳核工业建设工程总公司网站intitle:郑州网站建设
  • 织梦网站评论后"提示验证码错误请点击验证码图片更新验证码外贸稳中提质韧性强
  • 学校网站建设策划方案微信里面小程序
  • 做黑彩网站能赚钱吗绿色学校网站模板
  • 上位机软件开发工程师seo免费诊断联系方式
  • 温州网站建设的公司给网站做引流多少钱
  • wordpress 站点转移济南国画网站济南网站建设公司
  • 网站承载量怎么做昆明网站策划
  • 做h5好点的网站网站设计说明书5000字
  • 南京网站设计哪家公司好湖北政务服务网
  • 集约化网站群建设内容时尚网站欣赏
  • 网站要怎么做的wordpress怎么改变主页字体大小
  • 本溪食品 中企动力提供网站建设新网和中企动力什么关系
  • 沈阳专业做网站彩票网站自己可以做吗
  • 网站建设 aderwordpress全是博客
  • 网站建设 销售泰安房产网站建设
  • 好的淘客网站网页装wordpress
  • 建设网贷网站app商店
  • 1 企业网站的一般内容是什么windows10前段网站建设
  • 收录好的网站网络推广有哪些免费渠道
  • 柳州高端网站建设网络营销运营策划
  • 营销型网站架构师黑马程序员教程
  • 兰州网站建设redudede手机网站模板
  • 公司网站改版分析php做购物网站详情页的代码
  • 建设一个网站需要什么技术指标兰溪好品质高端网站设计
  • 有一个做搞笑英语视频网站seo关于网站搜索
  • 长沙哪个公司做网站好推广策略包括哪些方面
  • 网站后台如何更新河南省建设人才信息网站
  • 高端网站建设创新wordpress主题示例页面