@@ -30,7 +30,7 @@ public void writeSinglePointPerformance() throws InterruptedException {
3030 this .influxDB .enableBatch (2000 , 100 , TimeUnit .MILLISECONDS );
3131 Stopwatch watch = Stopwatch .createStarted ();
3232 for (int j = 0 ; j < SINGLE_POINT_COUNT ; j ++) {
33- Point point = new Point .Builder ("cpu" ).field ("idle" , j ).field ("user" , 2 * j ).field ("system" , 3 * j ).build ();
33+ Point point = Point .measurement ("cpu" ).field ("idle" , j ).field ("user" , 2 * j ).field ("system" , 3 * j ).build ();
3434 this .influxDB .write (dbName , "default" , point );
3535 }
3636 this .influxDB .disableBatch ();
@@ -46,13 +46,15 @@ public void writePerformance() {
4646 Stopwatch watch = Stopwatch .createStarted ();
4747 for (int i = 0 ; i < COUNT ; i ++) {
4848
49- BatchPoints batchPoints = new BatchPoints .Builder (dbName )
49+ BatchPoints batchPoints = BatchPoints
50+ .database (dbName )
5051 .time (System .currentTimeMillis (), TimeUnit .MILLISECONDS )
5152 .tag ("blubber" , "bla" )
5253 .retentionPolicy ("default" )
5354 .build ();
5455 for (int j = 0 ; j < POINT_COUNT ; j ++) {
55- Point point = new Point .Builder ("cpu" )
56+ Point point = Point
57+ .measurement ("cpu" )
5658 .field ("idle" , j )
5759 .field ("user" , 2 * j )
5860 .field ("system" , 3 * j )
@@ -74,7 +76,7 @@ public void maxWritePointsPerformance() {
7476
7577 Stopwatch watch = Stopwatch .createStarted ();
7678 for (int i = 0 ; i < 2000000 ; i ++) {
77- Point point = new Point .Builder ("s" ).field ("v" , 1 ).build ();
79+ Point point = Point .measurement ("s" ).field ("v" , 1 ).build ();
7880 this .influxDB .write (dbName , "default" , point );
7981 }
8082 System .out .println ("5Mio points:" + watch );
0 commit comments